-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
raw body is invoked too late? #15
Comments
Yes, it could be: why did you add an empty parser? |
The 3rd party app does not add the content-type header. If i do not add the wildcard parser, fastify would deny the request due to unsupported media type. I might have found a workaround, now. I read the request.raw stream into a buffer and do not use the fastify-raw-body plugin. |
No, from the performance side. |
Could you give me a hint, how to properly handle the error case? Why would a disconnect cause a memory leak?
The stream and the buffer are local variables, and should be freed by the GC when the method finished, right? |
Hi,
I've a strange problem.
I've built a small web app with NestJS and Fastify.
The app is receiving rest calls from an 3rd party app.
That's why I do not have influence on the requests. I've to take handle the requests as they come.
There're several requests, that store documents in an s3 storage.
The files can be sent as body of a PUT request.
I've a controller, that handles the request and stores the document.
For some requests, the raw body is called AFTER the controller has been invoked.
That said, the rawBody property is undefined in the controller.
I've attached the debugger in the
preparsingRawBody
and my controller.I do have attached an additional
contentTypeParser
as catch-all parser.Could that be a problem?
The text was updated successfully, but these errors were encountered: