Fixed time outs on http redirects

Fixed bug introduced by change 6ab86f50fd944b770ca388b478ce3cfb8b065647
where http request times out when it encounters a redirect.