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 caip10 and add body parser middleware #131

Merged
merged 11 commits into from
Feb 27, 2024
Merged

Fix caip10 and add body parser middleware #131

merged 11 commits into from
Feb 27, 2024

Conversation

samteb
Copy link
Contributor

@samteb samteb commented Feb 26, 2024

No description provided.

Comment on lines 55 to 59
map((app) => {
app.use(json({ limit: '50mb' }))
app.use(urlencoded({ extended: true, limit: '50mb' }))
return app
}),
Copy link
Collaborator

Choose a reason for hiding this comment

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

  • What's that for, precisely?
  • Would you mind adding in it in a high-order function like the others, please?
    • I feel it's doing two things: with json limit and with url encoding.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

@wcalderipe wcalderipe left a comment

Choose a reason for hiding this comment

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

So as you know, the PR's title doesn't match the changes. Suggestion: Add body parser middleware in the policy engine.

}

const withUrlEncoded = (app: INestApplication): INestApplication => {
app.use(urlencoded({ extended: true, limit: '50mb' }))
Copy link
Collaborator

@wcalderipe wcalderipe Feb 27, 2024

Choose a reason for hiding this comment

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

I thought NestJS already came with these included.

image

https://docs.nestjs.com/faq/raw-body

@samteb samteb merged commit 1b48714 into main Feb 27, 2024
5 checks passed
@samteb samteb deleted the fix-caip10 branch February 27, 2024 15:18
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.

2 participants