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

Add test for content-type overriding inside a plugin #1434

Merged
merged 2 commits into from Feb 5, 2019

Conversation

Marsup
Copy link

@Marsup Marsup commented Feb 5, 2019

Checklist

  • run npm run test and npm run benchmark
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message and code follows Code of conduct

Latest minor broke our server, since it now generates new parser functions every time, the hasParser comparison fails. I only included a unit test so far to show the problem, I don't know how you want to address it so I'd happily take guidance on this one and make the changes, or feel free to merge the failing test and fix it if it's faster for you.

Copy link
Contributor

@cemremengu cemremengu left a comment

Choose a reason for hiding this comment

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

LGTM

@cemremengu cemremengu added the test Issue or pr related to our testing infrastructure. label Feb 5, 2019
Copy link
Contributor

@cemremengu cemremengu left a comment

Choose a reason for hiding this comment

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

Apologies, the title misguided me

@Marsup
Copy link
Author

Marsup commented Feb 5, 2019

Sure, np :) We'd like to patch our server for the proto poisoning asap, so if you have any advice on how to fix that regression, I'll gladly take it :)

@mcollina
Copy link
Member

mcollina commented Feb 5, 2019

@Marsup you’ll need to pass along the kDefaultJSONParser property in the buildContentParser function at the end of the file. That should do the trick.

@Marsup
Copy link
Author

Marsup commented Feb 5, 2019

@mcollina Would my last commit do the trick?

@mcollina
Copy link
Member

mcollina commented Feb 5, 2019

Yes!

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

@delvedor
Copy link
Member

delvedor commented Feb 5, 2019

Latest minor broke our server

Sorry about that!

@mcollina should we apply this change also in master?

Copy link
Member

@delvedor delvedor left a comment

Choose a reason for hiding this comment

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

LGTM

@mcollina
Copy link
Member

mcollina commented Feb 5, 2019

@mcollina should we apply this change also in master?

Yes.

@mcollina mcollina merged commit 7bd2a45 into fastify:1.x Feb 5, 2019
mcollina pushed a commit that referenced this pull request Feb 5, 2019
* Add test for content-type overriding inside a plugin

* Copy default JSON parser from previous content type parser
delvedor pushed a commit that referenced this pull request Feb 5, 2019
@delvedor delvedor added bugfix Issue or PR that should land as semver patch and removed test Issue or pr related to our testing infrastructure. labels Feb 5, 2019
@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 Feb 10, 2022
@Marsup Marsup deleted the plugin-content-type-override branch February 10, 2022 09:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bugfix Issue or PR that should land as semver patch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants