-
-
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
Don't overwrite custom etag #3348
Conversation
🦋 Changeset detectedLatest commit: c054545 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 |
✔️ Deploy Preview for kit-demo canceled. 🔨 Explore the source changes: c054545 🔍 Inspect the deploy log: https://app.netlify.com/sites/kit-demo/deploys/61e30d5f11570500077d4f3b |
Thank you! Can you add a test and a changeset please? You could add a test to this section: kit/packages/kit/test/apps/basics/test/test.js Lines 690 to 735 in 9e482ac
|
Should we also, then, trust an |
Yes @Rich-Harris , I can add a test and the changeset, will do soon @Conduitry , I don't think there's a stateless (or serveless) way to check the user provided etag, I assume that if the etag is being set manually the user know what he's doing and will check the if-none-matches equality himself |
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.
Thanks — response inline
Was going to apply your suggestion right now, sorry to be late but thanks for all the work!! |
Kit should not overwrite custom etag value.
Sometimes it's useful to provide a custom etag value which should not be overwritten by sveltekit.
For example, in my particular use case, when proxying an image from S3 it's possible to retrieve the ETAG with the metadata, without downloading it.
This is also useful when the etag is based on api requests, making it possible to skip rendering the page.
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
pnpx changeset
and following the prompts. All changesets should bepatch
until SvelteKit 1.0