[fetch] Redirect handling is wrong for opaqueredirect (#212)

We should probably use the response url as the base URL, if there is one, and only if there isn't fallback to the current url. That is a little weird, but otherwise you can figure out where an "opaqueredirect" goes per @jakearchibald's example in #194:

> ```js
event.respondWith(fetch("//static.example.com/foo/", { redirect: 'manual' }))
```
>
> Where:
>
> * The request URL is `//example.com/bar/`
> * Request has a manual redirect mode
> * `//static.example.com/foo/` redirects to `/bar/`
> 
> This would result in redirecting to `//example.com/bar/` rather than `//static.example.com/bar/` right?

The alternative would be to add a check to step 3.3 of https://fetch.spec.whatwg.org/#http-fetch that for an opaqueredirect, request's current url has to match response' url.

What do folks prefer?

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/212

Received on Friday, 5 February 2016 10:15:22 UTC