-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
docs: Elaborate on credentialed fetch
behaviour
#10421
docs: Elaborate on credentialed fetch
behaviour
#10421
Conversation
🦋 Changeset detectedLatest commit: 46faacf The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
fetch
behaviour
fetch
behaviourcredentials: 'include'
is set, and elaborate on credentialed fetch
behaviour
credentials: 'include'
is set, and elaborate on credentialed fetch
behaviourcredentials: 'include'
is set, and elaborate on credentialed fetch
behaviour
After speaking to other maintainers, I conclude that this fix won't actually solve your problem, and it would open up security vulnerabilities. Won't solve the problem: Suppose we have sveltekit at site.com and an API at api.com
Security vulnerabilities: If To work around your specific problem you a) need to proxy your API request through your own domain and b) use handleFetch to forward the cookie manually. My suggestion is therefore:
|
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.
(as pointed out in the comment above)
@dummdidumm oh yeah I get that, good point. For my use case, I just want Would it be possible to add a limited version of |
If we're rendering an SSR request on This is what's discussed in the 'credentials' subsection in https://kit.svelte.dev/docs/hooks#server-hooks-handlefetch - Is this what you're asking about? |
@Conduitry oh it's literally right there, I should be able to make that work. I'll fix up this PR now - thanks for your help! |
credentials: 'include'
is set, and elaborate on credentialed fetch
behaviourfetch
behaviour
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.
Thank you!
Not sure what the preview deployment failure is about, but we probably have to address it before merging or it won't rebuilt the site in production |
I imagine it was what I fixed in #10431. I've merged master back into this branch. |
Changes:
credentials: 'include'
behaves identically tocredentials: 'same-origin'
Cookies and headers
section intoCookies
andHeaders