Skip to content

Commit 0949929

Browse files
committed
update authority-handling code and add comment
1 parent c964d7b commit 0949929

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/kit/src/exports/node/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,11 @@ export async function getRequest({ request, base, bodySizeLimit }) {
110110
if (request.httpVersionMajor >= 2) {
111111
// the Request constructor rejects headers with ':' in the name
112112
headers = Object.assign({}, headers);
113+
// https://www.rfc-editor.org/rfc/rfc9113.html#section-8.3.1-2.3.5
113114
if (headers[':authority']) {
114-
if (!headers.host) {
115-
headers.host = headers[':authority'];
116-
}
117-
delete headers[':authority'];
115+
headers.host = headers[':authority'];
118116
}
117+
delete headers[':authority'];
119118
delete headers[':method'];
120119
delete headers[':path'];
121120
delete headers[':scheme'];

0 commit comments

Comments
 (0)