-
Notifications
You must be signed in to change notification settings - Fork 2k
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
http->https 302 redirects are improperly rewritten #192
Comments
It also breaks redirects to other protocols (however uncommon that is). |
@quartzjer How would you go about fixing it? Honestly I'm not sure I follow what's wrong. |
If there's a front-end of https://external/ and a back-end of http://internal/ when the back-end sends a redirect to http://some-other-site.com/foo.bar this code will rewrite it to https://sime-other-site.com/foo.bar, which is generally a bad thing to be rewriting every redirect :) I honestly don't understand the original issue to suggest a fix as I'm not sure what the desired behavior would be, all I know is the current one is not desirable. |
Is there any way this can be fixed in master? I'm (undesirably) using a fork that just has this code commented out, and I don't know how this condition isn't horribly broken for everyone, every single redirect response is rewritten in this case. |
+1 @quartzjer -> You could create a clean pull request from that fork to accelerate the fix. |
I would, but I don't know what the problem is actually being solved so On Thu, Mar 15, 2012 at 4:59 PM, Olivier Vaillancourt
|
Yeah, looking at it, these lines (those commented out) do solve the specific problem of the user that submitted the fix but I'm pretty sure it's not really a desirable behaviour for a proxy... You pretty much irreversibly loose control over your protocol with this "fix". I think it should either be configurable in the proxy or managed on the app side. We're running an internal build of http-proxy that has the exact same lines commented out :P. |
Has there been any update on this issue? |
Should be fixed in 6a278b3 |
The pull req #165 introduced broken logic, it rewrites every redirect, such that if a proxied services 302's any url (in our instance, our https-fronted and http-back-end sends a redirect to instagram's http cdn).
https://github.com/elfsternberg/node-http-proxy/blob/411bb51cc6/lib/node-http-proxy/http-proxy.js#L216
It rewrites every single redirect regardless :(
The text was updated successfully, but these errors were encountered: