Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http: tidy up exposure of header validation #33371

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/_http_outgoing.js
Original file line number Diff line number Diff line change
Expand Up @@ -918,9 +918,8 @@ function(err, event) {
this.destroy(err);
};

OutgoingMessage.validateHeaderName = validateHeaderName;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this makes this patch semver-major?

Copy link
Contributor Author

@osher osher May 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lpinca - good spot. Here's the thing:

this line landed just about a week ago, and was decided to be done better as it is featured now in a discussion that continued after the landing in a friendly spirit.
It was also undocumented - it's an implementation detail.

If that's a problem - then I can leave that line.
LMK how to proceed.

OutgoingMessage.validateHeaderValue = validateHeaderValue;

module.exports = {
validateHeaderName,
validateHeaderValue,
OutgoingMessage
};
7 changes: 5 additions & 2 deletions lib/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down