-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
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
warn if recommended env vars are missing #7693
Conversation
Hm. In the absence of all of these, the adapter assumes that the origin is At work, I have a multitenant app (with an external API) and there I can't set an fixed explicit In this application, the only time I need to set I would tend towards "document this more explicitly", but I don't know where to do that other than in /~https://github.com/sveltejs/kit/tree/master/packages/adapter-node#origin-protocol_header-and-host_header which I know a lot of people aren't going to look at. |
The other thought I had was to document it at the point of need, i.e. when the cross-site-but-not-really POST fails. But it only actually affects |
I don't quite understand why this would happen. It doesn't seem like it should be necessary to me because doesn't it just use the kit/packages/adapter-node/src/handler.js Line 19 in 172e792
I guess you could also do it inside |
It does use the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd agree this seems like it'd cause more trouble than it'd save. I think updating the readme to describe when you need to override the default would be better
closing in favour of #7744 |
#7042. When using
adapter-node
, if theORIGIN
header is missing, andPROTOCOL_HEADER
andHOST_HEADER
aren't both set, then request URLs are very likely to be incorrect. That will result in the CSRF check misfiring, for example.I don't 100% know if this solution is appropriate but it's the best I've got
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. All changesets should bepatch
until SvelteKit 1.0