background-fetch icon indicating copy to clipboard operation
background-fetch copied to clipboard

Header equality

Open annevk opened this issue 6 years ago • 5 comments

  1. I guess this name is only for local use as it's oddly generic given the niche semantics?
  2. I'm a little concerned that this doesn't match implementations when multiple headers of the same name are present. Also, even if it does match them, I'd prefer that implementations treat Etag: x,x and Etag: x plus Etag: x identically. That'd be more in line with the spirit of HTTP.

annevk avatar Oct 02 '18 13:10 annevk

I guess this name is only for local use as it's oddly generic given the niche semantics?

Hmm, it's kinda meant to be generic. I might move it to the HTML spec to check values when resuming downloads.

I'm a little concerned that this doesn't match implementations

Gotcha. Will switch to combined value.

jakearchibald avatar Oct 03 '18 15:10 jakearchibald

@annevk if one request has Foo: with no value, and the other request has no Foo header, should they be considered equal?

jakearchibald avatar Oct 03 '18 16:10 jakearchibald

Is https://github.com/WICG/background-fetch/pull/127 good enough when doing header comparison?

jakearchibald avatar Oct 03 '18 17:10 jakearchibald

That looks okay. To answer your earlier question: Foo without value and no Foo are not equivalent. Foo: bar and Foo without value (i.e., Foo: bar\r\nFoo: \r\n) are equivalent to Foo: bar, per HTTP, but Fetch currently doesn't specify these semantics and I'm not sure to what extent implementations are on board with this.

annevk avatar Oct 04 '18 13:10 annevk

For a generic concept, "equals" or maybe "is" would be the name I think (see URL Standard for precedent) and as used here it'd be about header values, not headers.

@domenic as we should probably settle on "equals" or "is" at some point in the Infra Standard.

annevk avatar Oct 04 '18 13:10 annevk