-
Notifications
You must be signed in to change notification settings - Fork 118
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
ERR_HTTP_HEADERS_SENT when upload file endpoint alias throws error. #200
Comments
Please provide a repro example. |
@icebob |
@icebob any update on this? |
@icebob Sorry to bother... had you have the chance to see this? |
I have the same issue.
=> I get a ERR_HTTP_HEADERS_SENT error in the onAfterCall hook when trying to change a res header after the alias has encountered an error and responded... My workaround :
|
This worked for me too, thank you! |
Hi there, same thing here, a lot of issues with busboy and uploading files. If the service is in a node, not the gateway, a lot of issues happens, this part is not well tested. I tried more than one file and get several requests, I tried one file, I can't validate the fields and stop the busboy uploading. Very different from fastify or express where I have total control of the upload. Anyway moleculer is great, this is the first big issue that I found, I have been working with moleculer for a couple of years now. Excelent project, we can't find any replacement for it, the way it works is outstanding =) |
The integrated busboy is just an option for file uploading. You can disable it and add another Express middleware solution like formidable. I've just created another file upload example with formidable: https://github.com/moleculerjs/moleculer-web/blob/master/examples/formidable/index.js |
Hi @icebob .. perfect.. Here you have access tô the request. But what is the case when we are in a node defined by an alias route and using rest notation. More specific the handle function. The handle function does not have access tô the request but only the context right? Thanks in advanced for your time and patience tô this matter. 🙏🙏 |
Yes, you have no access to |
@icebob perfect. Excelent project 🙏🙏 |
Issue
I'm facing an issue with moleculer-web file-upload alias... I get a
ERR_HTTP_HEADERS_SENT
error in theonAfterCall
hook when trying to change a res header after the alias has encountered an error and responded...Possible causes
I think this is an issue with the Busboy implementation... When I throw an error inside an endpoint like this, this catch block (
moleculer-web/src/alias.js
Line 169 in f4669da
The text was updated successfully, but these errors were encountered: