-
-
Notifications
You must be signed in to change notification settings - Fork 2k
[breaking] strip __data.json from url #7979
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
Conversation
🦋 Changeset detectedLatest commit: 404c39a 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 |
4b29591
to
5d9951e
Compare
@@ -44,6 +44,17 @@ export const handle = sequence( | |||
event.locals.answer = 42; | |||
return resolve(event); | |||
}, | |||
({ event, resolve }) => { | |||
if ( | |||
event.request.url.includes('__data.json') && |
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.
this would prevent contrived-but-allowed things like /__data.json/wheee
, no? Don't we just want to check the end of the pathname?
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.
This is just part of a test, not the code that users are going to run.
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 definitely knew that and wasn't just being absent-minded
This is breaking change for people who relied on the
__data.json
suffix being present onevent.url
which is now no longer the case. Use the newisDataRequest
boolean instead.closes #7926
Open question: Should we also remove those things from the original
request
object? I vote for "no".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