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

Ignore Buffer metatypes in validation pipe #5374

Merged

Conversation

kkoomen
Copy link
Contributor

@kkoomen kkoomen commented Sep 2, 2020

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: N/A

I'm using Stripe in my Nest project and for Stripe callbacks we use a raw body. The code in our codebase is like this: async stripeCallback(@Body() rawBody: Buffer) { ... } and because I've applied a global validation pipe, it's trying to validate a Buffer which should not happen.

What is the new behavior?

It ignores the Buffer type.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@kkoomen kkoomen changed the title feat(validation.pipe): ignore buffer metatypes Ignore Buffer metatypes in validation pipe Sep 2, 2020
@coveralls
Copy link

Pull Request Test Coverage Report for Build 33b3e109-8464-40cc-a03d-b11b6a461faf

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 94.818%

Totals Coverage Status
Change from base Build 989e1c9c-d326-4400-b104-848cb98c7561: 0.0%
Covered Lines: 4922
Relevant Lines: 5191

💛 - Coveralls

Copy link
Member

@jmcdo29 jmcdo29 left a comment

Choose a reason for hiding this comment

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

LGTM

@kamilmysliwiec
Copy link
Member

Looks great! Thanks. It will be added in the next patch/minor release

@kamilmysliwiec kamilmysliwiec reopened this Sep 7, 2020
@kamilmysliwiec kamilmysliwiec merged commit 85c6be1 into nestjs:master Sep 7, 2020
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

4 participants