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.
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.
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.