Fixed time out on HTTP redirects

Fixed a bug introduced by change 6ab86f50fd944b770ca388b478ce3cfb8b065647
where an HTTP request will time out when it encounters a URL redirection.