http: correct error message for invalid trailer

Prevent misleading error messages when trailers are invalid.

PR-URL: https://github.com/nodejs/node/pull/6308
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Brian White <mscdex@mscdex.net>
pull/6380/merge
Bryan English 2016-04-20 10:44:01 -07:00 committed by James M Snell
parent e556dd3856
commit 31bef6b704
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}