Skip to content
Merged
Changes from 1 commit
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
6 changes: 5 additions & 1 deletion lib/_http_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
this._url += url;
}

const HTTP_VERSION_1_1 = '1.1';

// `headers` and `url` are set only if .onHeaders() has not been called for
// this request.
// `url` is not set for response parsers but that's not applicable here since
Expand Down Expand Up @@ -91,7 +93,9 @@
const incoming = parser.incoming = new ParserIncomingMessage(socket);
incoming.httpVersionMajor = versionMajor;
incoming.httpVersionMinor = versionMinor;
incoming.httpVersion = `${versionMajor}.${versionMinor}`;
incoming.httpVersion = versionMajor === 1 && versionMinor === 1
? HTTP_VERSION_1_1

Check failure on line 97 in lib/_http_common.js

View workflow job for this annotation

GitHub Actions / lint-js-and-md

'?' should be placed at the end of the line
: `${versionMajor}.${versionMinor}`;

Check failure on line 98 in lib/_http_common.js

View workflow job for this annotation

GitHub Actions / lint-js-and-md

':' should be placed at the end of the line
incoming.joinDuplicateHeaders = socket?.server?.joinDuplicateHeaders ||
parser.joinDuplicateHeaders;
incoming.url = url;
Expand Down
Loading