Handle redirects

The new URL reported by the connection is recorded and passed to upper
layers. This allows correct navigation and resolution of relative
resources.