Fastify Swagger + TypeORM break application/x-www-form-urlencoded parsing
See original GitHub issueI’m submitting a…
[ ] Regression
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
500 error when a body with application/x-www-form-urlencoded
type is sent. Happens when Swagger is used in conjunction with TypeORM.
Expected behavior
application/x-www-form-urlencoded
body is parsed.
Minimal reproduction of the problem with instructions
npm run start:dev
, then curl -da=b localhost:3000
Commenting out either the SwaggerModule.setup
or TypeOrmModule.forRoot
call causes the issue not to occur.
Environment
Nest version: 7.0.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
fastify-formbody and fastify-http-proxy are changing ...
I am using fastify to proxy calls to spring boot backend. Using fastify-http-proxy as proxy and application/x-www-form-urlencoded content ...
Read more >npm - Snyk
@alancnet/fantasy-names · @alexamies/chinesedict-js · @alifd/next · @alpacahq/alpaca-trade-api · @amcharts/amcharts3-angular · @amcharts/amcharts4 ...
Read more >Search Results - CVE
This vulnerability could allow an attacker to set arbitrary and unexpected keys on the object returned from `JSON5.parse`. The actual impact will depend...
Read more >Unsupported media type \"application/x-www-form-urlencoded
Fastify, out of the box, parse only application/json payload. To manage forms you need to add these plugins to your project.
Read more >infinite scroll in react Code Example - Code Grepper
sendFile · jquery delete grand parent of clicked element · react native image fit container · use application/x-www-form-urlencoded in javascript ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Another temporary workaround (disable built-in bodyParser and enable formbody manually)
Adding
await app.init()
should fix this issue. It seems that the body parser plugin must be registered beforefastify-swagger
(in fastify v3)