-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
fix: respond with 200 to HEAD requests for non-prerendered pages as well #13101
Conversation
🦋 Changeset detectedLatest commit: 51b1adb The changes in this PR will be included in the next version bump. 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 |
CodSpeed Performance ReportMerging #13101 will not alter performanceComparing Summary
|
I don't understand why the test fails, is there maybe another big somewhere in HEAD handling? Or is this in the test utils? When I test locally, I get 200 for head now. |
You will need to update the fixture. Here is what I did in my pull request. I just added a index.astro to the csrf-check-origin fixture. You could also add a API route for HEAD requests. Not sure which is best. |
@corneliusroemer are still interested in this fix? If you don't have time, let us know, so we can carry over it to the finish line |
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 added more tests and removed TRACE
because it isn't supported by undici
Changes
Fixes #13079
Fixes #13104
Fixes #13103
Also ensure that HTTP method CONNECT gets origin checked as well (it was previously wrongly omitted because only POST, PUT, PATCH, DELETE were previously checked).
Inspired by @joshmkennedy's PR #13100
Testing
Add test for HEAD getting correct HTTP response 200 (this would have failed prior to his prior)
Docs
Pure bug fix, no docs changes necessary