Issue with following redirects

when a request (eg "/" redirects using a Location: header, a exception occurs because $uri is a header-object and is used as array ($uri[0]). this patch extracts the location uri from the header