Closed dmathieu closed 13 years ago
Why should we send a redirect back to the browser when the host or port changes?
In my case, I'm authenticating with OAuth. So I have three development applications :
When I want to authenticate on the sproutcore app, I redirect to the locally proxied uri on the sinatra app, which redirects to the API in order to follow the OAuth protocol. However in the current master, the API app remains proxied by Abbot. But the login form can't work as when validating it, it'll try to load the sinatra app, not the rails one.
In production, the proxy would disappear and the sinatra and sproutcore apps would be on the same host. So when I redirect to the rails app, it'd really redirect to it and not remain on the same host.
I hope that's clear enough :)
Is there something unclear about my explanations or the pull request which makes you hold it ?
I need this fix as well, otherwise I end up on port 80 instead of a custom port when I do a proxied redirect (for a authentication scenario)
I have rebased my fork in order to remove all the noise commits, it should make the pull request more readable.
Hello,
These two commits are fixing two proxy bugs, encountered when the backend server sends redirections to different uris or ports.
headers['Host']
after every redirect, therefor avoiding to have an inappropriate host if it has been changed.