We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
url.host
undefined
May be related to #3566
Using a custom server with adapter-node's handler.js to serve over HTTP/2 causes the reported hostname in URLs to be undefined.
adapter-node
handler.js
hostname
Repo: https://github.com/aradalvand/sveltekit-adapter-node-http2-repro
Clone, run pnpm install, then pnpm run build, and finally node server.js (remember to use the custom server.js, don't run node build).
pnpm install
pnpm run build
node server.js
server.js
node build
Then send a request to https://localhost:3000/test:
https://localhost:3000/test
Check server logs (the related console.log is in src/routes/test/+server.js)::
console.log
src/routes/test/+server.js
Notice that the host, hostname and so on are undefined; they should obviously be localhost.
host
localhost
No response
System: OS: Linux 5.10 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish) CPU: (4) x64 Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz Memory: 17.05 GB / 18.67 GB Container: Yes Shell: 5.8.1 - /bin/zsh Binaries: Node: 18.12.1 - /usr/bin/node Yarn: 1.22.19 - /usr/bin/yarn npm: 9.3.0 - /usr/bin/npm npmPackages: @sveltejs/adapter-node: ^1.2.4 => 1.2.4 @sveltejs/kit: ^1.5.0 => 1.20.4 svelte: ^3.54.0 => 3.59.1 vite: ^4.3.0 => 4.3.9
blocking an upgrade
The text was updated successfully, but these errors were encountered:
url.hostname
Closed by #12989
Sorry, something went wrong.
No branches or pull requests
Describe the bug
May be related to #3566
Using a custom server with
adapter-node
'shandler.js
to serve over HTTP/2 causes the reportedhostname
in URLs to beundefined
.Reproduction
Repo: https://github.com/aradalvand/sveltekit-adapter-node-http2-repro
Clone, run
pnpm install
, thenpnpm run build
, and finallynode server.js
(remember to use the customserver.js
, don't runnode build
).Then send a request to
https://localhost:3000/test
:Check server logs (the related
console.log
is insrc/routes/test/+server.js
)::Notice that the
host
,hostname
and so on areundefined
; they should obviously belocalhost
.Logs
No response
System Info
Severity
blocking an upgrade
Additional Information
No response
The text was updated successfully, but these errors were encountered: