Skip to content
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: fix for automatic HEAD routes #2

Merged
merged 1 commit into from
Oct 16, 2022
Merged

Conversation

landonbar
Copy link
Contributor

@landonbar landonbar commented Sep 26, 2022

Fastify 4 creates sibling HEAD routes for GET routes by default.
https://www.fastify.io/docs/latest/Guides/Migration-Guide-V4/#exposeheadroutes-true-by-default

This causes an error in the split validator when the path exists (via GET) but the HEAD method does not.

This fix covers that case.

HEAD routes now get automatically added in Fastify causing and issue when the path exists (via GET) but the HEAD method does not. This fix covers that case.
Copy link
Owner

@metcoder95 metcoder95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks a lot for the contribution, can you just add a small test that covers the change, so we have a checkpoint for future releases? 🙂

@metcoder95 metcoder95 changed the base branch from main to v3 September 28, 2022 19:47
@metcoder95
Copy link
Owner

Skipping tests for now, as needed for release of v2 with support for fastify@v4

@metcoder95 metcoder95 changed the title Fix for automatic HEAD routes fix: fix for automatic HEAD routes Oct 16, 2022
@metcoder95 metcoder95 merged commit 4d23437 into metcoder95:v3 Oct 16, 2022
metcoder95 pushed a commit that referenced this pull request Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants