From e30a65193792d76e204e4558a404b7e9d5a12f41 Mon Sep 17 00:00:00 2001 From: Osher Date: Tue, 12 May 2020 18:29:09 +0300 Subject: [PATCH] http: tidy up exposure of header validation PR-URL: https://github.com/nodejs/node/pull/33371 Reviewed-By: Anna Henningsen Reviewed-By: Benjamin Gruenbaum Reviewed-By: Luigi Pinca Reviewed-By: Ruben Bridgewater --- lib/_http_outgoing.js | 5 ++--- lib/http.js | 7 +++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index bfe32942537..dade9a11014 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -919,9 +919,8 @@ function(err, event) { this.destroy(err); }; -OutgoingMessage.validateHeaderName = validateHeaderName; -OutgoingMessage.validateHeaderValue = validateHeaderValue; - module.exports = { + validateHeaderName, + validateHeaderValue, OutgoingMessage }; diff --git a/lib/http.js b/lib/http.js index 2b01e1edf5e..4bbe42e652c 100644 --- a/lib/http.js +++ b/lib/http.js @@ -29,8 +29,11 @@ const httpAgent = require('_http_agent'); const { ClientRequest } = require('_http_client'); const { methods } = require('_http_common'); const { IncomingMessage } = require('_http_incoming'); -const { OutgoingMessage } = require('_http_outgoing'); -const { validateHeaderName, validateHeaderValue } = OutgoingMessage; +const { + validateHeaderName, + validateHeaderValue, + OutgoingMessage +} = require('_http_outgoing'); const { _connectionListener, STATUS_CODES,