avoid exception with Location header redirects

when a request (eg "/" redirects using a Location: header /de/), an exception occurs because $uri is an header-object and is used as array ($uri[0]). this patch extracts the location uri from the header and continues with the location url.
The patch does not solve redirects that expect other headers to be resend (eg auth/post)