-
Notifications
You must be signed in to change notification settings - Fork 16
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
fix proxy body write condition #350
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR broke proxying as a whole. I think it should have been |
but 304 indicates that there would be no body and nothing to rewrite? Checking that it is not 304 before attempting to rewrite the body makes sense. Checking that it has to be 304 in order to perform the rewrite doesn't make sense.
Also, I made this change locally (since I needed it to rewrite stuff in the body) and it worked fine for me. Previously it was not rewriting the body as I believe it was supposed to so I went looking and found this. |
What
That to me indicates we successfully rewrote the payload but the content length didn't get auto updated using the node module. From looking at it with @robmcguinness it seems like the middleware was added but the logic never worked for 2 years which is why we didn't run into this error the first time we added it is what I am thinking SidenoteI reverted it for now and commented out the logic until we can find the issue that was happening and fix it for good. |
Yeah, I am using axios. |
Created an issue so we don't lose track of this |
You only need to bump the version of node-http-proxy-json. Looks like the one you were using was really old. |
It also appears the lib handles empty payloads now langjt/node-http-proxy-json@9b9f7d3 |
AFAICT the current condition can never be true?
With this change, it will be true when
![image](https://user-images.githubusercontent.com/664714/67707263-8bf1d780-f990-11e9-86ff-eb698f37e42f.png)
![image](https://user-images.githubusercontent.com/664714/67707283-9613d600-f990-11e9-948d-9ed7664719e4.png)
proxyObject.statusCode
is not 304