Skip to content

Commit

Permalink
fix: #43 use custom content type parser for application/json and text…
Browse files Browse the repository at this point in the history
…/plain

Pipe the request stream for these content types instead of the default handling. See https://www.fastify.io/docs/latest/ContentTypeParser/.
  • Loading branch information
thebengeu committed Jul 13, 2021
1 parent 00708b9 commit d36e32a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/routes/object/createObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ export default async function routes(fastify: FastifyInstance) {
tags: ['object'],
})

fastify.addContentTypeParser(
['application/json', 'text/plain'],
function (request, payload, done) {
done(null)
}
)

fastify.post<createObjectRequestInterface>(
'/:bucketName/*',
{
Expand Down

0 comments on commit d36e32a

Please # to comment.