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

Check if route exist before checking Content-Type of body #4286

Merged
merged 5 commits into from Sep 18, 2022

Conversation

mage1k99
Copy link
Contributor

Checklist

@Uzlopak
Copy link
Contributor

Uzlopak commented Sep 17, 2022

Cant we check before we run the content type parser if we havea 404?

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mage1k99
Copy link
Contributor Author

mage1k99 commented Sep 17, 2022

Cant we check before we run the content type parser if we havea 404?

Yes that is possible. I checked with the tests. seems like I was bit wrong in understanding the comment.

- check if the route is 404 only if the content-parser is undefined
by this we can avoid breaking changes.
- this also passes previous tests

this resolves issue
- fastify/fastify-multipart#381
@mage1k99
Copy link
Contributor Author

I have updated the check. thanks to @Uzlopak for giving me hint

All the tests now passes

lib/contentTypeParser.js Outdated Show resolved Hide resolved
mage1k99 and others added 2 commits September 18, 2022 00:58
Noted, thanks for the review

Co-authored-by: Manuel Spigolon <behemoth89@gmail.com>
@Eomm Eomm merged commit 4109b03 into fastify:main Sep 18, 2022
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants