sproutcore / abbot

SproutCore Build Tools [deprecated]
http://www.sproutcore.com
88 stars 44 forks source link

Proxy errors when visiting sites that redirect from `site.com:80` to `site.com` #12

Closed geoffreyd closed 13 years ago

geoffreyd commented 13 years ago

Because the proxy forces the use of a port, we get an infinite redirect loop for sites that redirect away from a set port.

ie. search.twitter.com:80 -> search.twitter.com

If the site is using port 80, the proxy shouldn't force it's usage by default. More info: http://groups.google.com/group/sproutcore/browse_thread/thread/4bfb21d9875eab2b

dmathieu commented 13 years ago

I see the exact same with an other port than 80. My proxied application redirects to a local URI, which is not on port 80 but on 3000.

However the proxy forces the redirect to 80.

~ PROXY: GET 403 /auth/homelet -> http://localhost:80/oauth?client_id=homelet_dev&redirect_uri=http%3A%2F%2Flocalhost%3A9292%2Fauth%2Fhomelet%2Fcallback&type=web_server
   date: Thu, 17 Feb 2011 14:06:42 GMT
   server: Apache/2.2.13 (Unix) mod_ssl/2.2.13 OpenSSL/0.9.8k DAV/2
   content-length: 207
   content-type: text/html; charset=iso-8859-1

This does not seem appropriate. I think the proxy should redirect too if there's a 301 or 302. Proxying is only used in development and in production the server will really redirect. Therefor, we have different behavior depending of the environment.

dmathieu commented 13 years ago

I've forked and fixed my problem. I guess this should also fix yours. https://github.com/sproutcore/abbot/pull/32

wagenet commented 13 years ago

@geoffreyd, did #32 fix it? If not, can you test #53?

publickeating commented 13 years ago

This should be fixed in master now. Can anyone confirm?

publickeating commented 13 years ago

Haven’t heard anyone with this still an issue. Please re-open if that is not the case.

dmathieu commented 13 years ago

That's because it got fixed in #32