Re: [whatwg/fetch] Location header is the empty string (#669)

Good catch on 5.2 and 5.3. I just assumed location would be the empty string, which is a value.
Editing slightly from @yutakahirano 's [comment](https://chromium-review.googlesource.com/c/chromium/src/+/910753/1/third_party/WebKit/LayoutTests/external/wpt/fetch/api/redirect/redirect-empty-location.js#12) on the CL:

- An empty value is a valid http header value.
  http://httpwg.org/specs/rfc7230.html#header.fields
- 5th step of https://fetch.spec.whatwg.org/#http-fetch says
   2. Let location be the result of extracting header list values given `Location`
      and actualResponse’s header list.
   3. If location is a value, then set location to the result of parsing location
      with actualResponse’s url.
- https://url.spec.whatwg.org/#concept-url-parser returns a new URL if |input| is
  empty and |url| is not given (the basic URL parser is given input == "", and base == actualResponse's url, |url| is not given, so it gets set to a new URL and seems like it never gets touched).
- https://fetch.spec.whatwg.org/#concept-http-redirect-fetch asks us to return a
  network error if the locationURL's scheme is no HTTP(S).


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/669#issuecomment-364456723

Received on Friday, 9 February 2018 14:59:06 UTC