Skip to content

Commit

Permalink
update authority-handling code and add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Nov 11, 2024
1 parent c964d7b commit 0949929
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/kit/src/exports/node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,11 @@ export async function getRequest({ request, base, bodySizeLimit }) {
if (request.httpVersionMajor >= 2) {
// the Request constructor rejects headers with ':' in the name
headers = Object.assign({}, headers);
// https://www.rfc-editor.org/rfc/rfc9113.html#section-8.3.1-2.3.5
if (headers[':authority']) {
if (!headers.host) {
headers.host = headers[':authority'];
}
delete headers[':authority'];
headers.host = headers[':authority'];
}
delete headers[':authority'];
delete headers[':method'];
delete headers[':path'];
delete headers[':scheme'];
Expand Down

0 comments on commit 0949929

Please sign in to comment.