Skip to content

adapter-node over HTTP/2 url.host is undefined #10310

Closed
@aradalvand

Description

@aradalvand

Describe the bug

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.

Reproduction

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).

Then send a request to https://localhost:3000/test:

image

Check server logs (the related console.log is in src/routes/test/+server.js)::
image

Notice that the host, hostname and so on are undefined; they should obviously be localhost.

Logs

No response

System Info

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

Severity

blocking an upgrade

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions