Fixed a bug caused by url redirects.

Fixed an issue where when a url is redirected, nothing would be
returned.