Skip to content

Commit

Permalink
chore: beauty code (#3799)
Browse files Browse the repository at this point in the history
  • Loading branch information
xtx1130 committed Mar 29, 2022
1 parent af49144 commit b9046c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/reply.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Reply.prototype.send = function (payload) {
// If user doesn't set charset, we will set charset to utf-8
if (contentType.indexOf('charset') === -1) {
const customContentType = contentType.trim()
if (customContentType.lastIndexOf(';') === customContentType.length - 1) {
if (customContentType.endsWith(';')) {
// custom content-type is ended with ';'
this[kReplyHeaders]['content-type'] = `${customContentType} charset=utf-8`
} else {
Expand Down

0 comments on commit b9046c2

Please sign in to comment.