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

feat(server): allow suppressing bodyParser to use own middleware #877

Merged

Conversation

jorisdugue
Copy link
Contributor

Hi thanks for this project 😄

This PR allows to use fastify in custom middleware. Without this PR you cannot wrap this express server due to bodyParser

@google-cla
Copy link

google-cla bot commented Feb 25, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@connorjclark connorjclark changed the title feat(server): allow use custom server feat(server): allow suppressing bodyParser to use own middleware Mar 6, 2023
Copy link
Collaborator

@connorjclark connorjclark left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me. Thanks, especially for writing an example!

@connorjclark connorjclark merged commit 20d08c0 into GoogleChrome:main Mar 6, 2023
// 1. Support large payloads because LHRs are big.
// 2. Support JSON primitives because `PUT /builds/<id>/lifecycle "sealed"`
app.use(bodyParser.json({limit: '10mb', strict: false}));
if (typeof useBodyParser === 'undefined' || useBodyParser) {
Copy link
Member

Choose a reason for hiding this comment

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

little late but.. maybe we flip the flag so we don't have to do this kinda check?

dontUseBodyParser or skipBodyParser ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants