Skip to content

Cross-site POST form submissions are forbidden #6589

@asoltys

Description

@asoltys

Describe the bug

I'm getting an error message about a cross-site request when submitting a form to a relative URL that's handled by an endpoint on the same server.

The error only occurs when running the production build with the node-adapter, not with the dev server.

Reproduction

https://github.com/asoltys/svelte-cross-site-repro

Logs

Cross-site POST form submissions are forbidden

System Info

System:
    OS: Linux 5.19 Pop!_OS 22.04 LTS
    CPU: (12) x64 Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
    Memory: 4.55 GB / 15.35 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 18.7.0 - ~/.local/share/pnpm/node
    npm: 8.15.0 - ~/.local/share/pnpm/npm
  Browsers:
    Chrome: 104.0.5112.101
    Firefox: 103.0
  npmPackages:
    @sveltejs/adapter-auto: next => 1.0.0-next.71 
    @sveltejs/adapter-node: 1.0.0-next.88 => 1.0.0-next.88 
    @sveltejs/kit: next => 1.0.0-next.470 
    svelte: ^3.44.0 => 3.50.0 
    vite: ^3.1.0 => 3.1.0

Severity

serious, but I can work around it

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions