Permalink
Browse files

http: correct error message for invalid trailer

Prevent misleading error messages when trailers are invalid.

PR-URL: #6308
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Brian White <mscdex@mscdex.net>
  • Loading branch information...
bengl authored and jasnell committed Apr 20, 2016
1 parent e556dd3 commit 31bef6b704d7018b4e11778520accfe1e6001b73
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/_http_outgoing.js
@@ -519,7 +519,7 @@ OutgoingMessage.prototype.addTrailers = function(headers) {
'Trailer name must be a valid HTTP Token ["' + field + '"]');
}
if (common._checkInvalidHeaderChar(value) === true) {
throw new TypeError('The header content contains invalid characters');
throw new TypeError('The trailer content contains invalid characters');
}
this._trailer += field + ': ' + escapeHeaderValue(value) + CRLF;
}

0 comments on commit 31bef6b

Please sign in to comment.