From 31bef6b704d7018b4e11778520accfe1e6001b73 Mon Sep 17 00:00:00 2001 From: Bryan English Date: Wed, 20 Apr 2016 10:44:01 -0700 Subject: [PATCH] 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 Reviewed-By: Anna Henningsen Reviewed-By: Brian White --- lib/_http_outgoing.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index 77bfe4ba77..e1e78e010c 100644 --- a/lib/_http_outgoing.js +++ b/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; }