-
Notifications
You must be signed in to change notification settings - Fork 835
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
[ERROR] - JSON POST BODY #455
Comments
Can't really do anything without minimal reproducible example. |
@chimurai Sorry forgot to update here. I was able to figure out a fix for the issue from my side. Thanks for taking time to review the issue. |
Would be nice if you could share your solution for developers running into the same issue. |
I tried this from #320 (comment) and it worked for me.
|
@chimurai @geoangelotti Sorry for the delay in responding. Back i already had in that order even after that it was causing me issues, for me it was a specific issue of post body being greater than 1KB. For some reason something was adding a header i had to delete below headers before passing the request object to the proxy middleware and everything worked fine after that. |
Is this a question?
When using it with express server and trying to post json body, it seems like anything above 1KB since request fails. I tried using express.json() middle also body parser but it does not seem to go along smoothly with the proxy middleware. Any help regarding this issue would be helpful. Thanks in advance for the time.
this.app
.use(this.parseRequestBody.bind(this))
.use('*', apiProxy)
.use(express.json())
.listen(proxyPort);
Is this a bug report?
Yes
Is this a feature request?
No
{
// This value is not used but this is mandatory.
target: proxyPort.toString(),
changeOrigin: true,
followRedirects: true,
preserveHeaderKeyCase: true,
pathRewrite: this.rewritePath.bind(this),
router: this.rewriteHost.bind(this),
onError: function onError(err, _req, _res) {
// TODO: In future expose it as a callback.
},
onProxyReq: this.onProxyReq.bind(this)
}
(Paste the link to an example project and exact instructions to reproduce the issue.)
The text was updated successfully, but these errors were encountered: