sproutcore / abbot

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

Fixes a bug with automatically following redirects to external hosts #74

Closed floriankugler closed 12 years ago

floriankugler commented 13 years ago

em-http-request automatically follows redirects, however it always keeps the host header from the original request. Therefore redirects to external hosts do not work.

This is related to what is described here: https://github.com/igrigorik/em-http-request/issues/110

I've added the small em-http-request middleware to clear the Host field from the request header in case of redirects so that the Host field gets set with the new host from the redirect response Location header.