-
Notifications
You must be signed in to change notification settings - Fork 134
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
Large request bodies cannot be proxied #25
Comments
I ran up against this, too. I ran the requests through Burp proxy and the UI makes a GET request for the index fields and then returns them back to ESS in a POST body. I didn't have time to figure out why the response to the initial GET is handled fine but the subsequent POST is rejected. But I can see that the UI is sending a >100kb body to that subsequent POST request. As a monkey patch, I edited node_modules/body-parser/lib/types/raw.js on line 37 to up the body limit size to 500kb:
|
This issue is in http-proxy. the on.( 'proxyReq') in index.js is performed too late. So, the lib/http-proxy/common.js should have this code in common.setupOutgoing(...) before the return: Finally, translate what used to be in proxy.on('proxyReq'...) into the function:
} I also had to change the way the Host name was sent, but that's in another request. |
Also got this issue using kibana:
Same requests work when I don't use proxy |
@cgballance Do you have an example of those changes or a repo where it's been implemented? |
Sorry, had it on a work laptop that i gave back to my client. If you can't decipher, i'll set up es and redo. Let me know |
When sending a large (>100kb) body the proxy fails:
Assuming the proxy is running on localhost:
=> body parser error:
However increasing the bodyparser limit causes other issues:
=> Error: Can't set headers after they are sent.
at ClientRequest.OutgoingMessage.setHeader (_http_outgoing.js:357:11)
Is there a workaround for this issue?
The text was updated successfully, but these errors were encountered: