Skip to content

Commit 4f01f04

Browse files
authored
fix: handling of PROTOCOL_HEADER and HOST_HEADER env vars (#14221)
1 parent ea95533 commit 4f01f04

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/floppy-memes-warn.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/adapter-node': patch
3+
---
4+
5+
fix: handling of PROTOCOL_HEADER and HOST_HEADER env vars

packages/adapter-node/src/handler.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ function sequence(handlers) {
182182
* @returns
183183
*/
184184
function get_origin(headers) {
185-
const protocol = (protocol_header && headers[protocol_header]) ?? 'https';
186-
const host = (host_header && headers[host_header]) ?? headers['host'];
185+
const protocol = (protocol_header && headers[protocol_header]) || 'https';
186+
const host = (host_header && headers[host_header]) || headers['host'];
187187
const port = port_header && headers[port_header];
188188

189189
return port ? `${protocol}://${host}:${port}` : `${protocol}://${host}`;

0 commit comments

Comments
 (0)