You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: handle JSON bodies for proxied POST, PUT, DELETE APIs
Fixes an issue where proxied[1] APIs that took JSON content
on POST, PUT or DELETE would fail with a timeout.
The cause was a combination of when the Podium plugin runs in
Fastify's lifecycle[2], that Fastify ships a built-in content
parser for JSON[3], and that our proxy depended on the request
ReadableStream emitting data in order to work.
Our proxy would end up coming in too late, after the request
stream had been consumed.
The fix is to remove the content type parser for proxied routes,
since we in any case aren't interested in the request contents
at the layout level.
[1]: https://podium-lib.io/docs/guides/proxying
[2]: https://fastify.dev/docs/latest/Reference/Lifecycle/
[3]: https://fastify.dev/docs/latest/Reference/ContentTypeParser/
0 commit comments