Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variants' incoming-request assumes all content-negotiation systems' Accept headers are lists #734

Closed
jyasskin opened this issue Dec 7, 2018 · 2 comments
Labels

Comments

@jyasskin
Copy link
Contributor

jyasskin commented Dec 7, 2018

https://httpwg.org/http-extensions/draft-ietf-httpbis-variants.html#cache says:

Given incoming-request (a mapping of field-names to lists of field values)

It doesn't specify how to calculate this from the HTTP request (https://fetch.spec.whatwg.org/#requests? I don't see a version-independent definition of a request in the HTTP specs.) that the cache actually receives, and it doesn't deal with request headers like https://httpwg.org/http-extensions/client-hints.html#dpr that hold a single value instead of a list.

@mnot
Copy link
Member

mnot commented Jan 8, 2019

Are you looking for text that effectively says:

If the header is defined to be a single value, take the first instance of the header field and put its value into a list. If the header is defined to be a list (e.g., using the #rule), parse each instance of the header field into a list and combine all of those lists.

?

note that work on http-core might help here; e.g., see httpwg/http-core#116

@jyasskin
Copy link
Contributor Author

jyasskin commented Jan 8, 2019

#735 changed the use of incoming-request to say

Let request-value be the field-value associated with field-name in incoming-request (after being combined as allowed by Section 3.2.2 of [RFC7230])

which I think is good (but I would since I wrote it). The declaration of incoming-request could say the same thing.

I'd rather have this part of this spec not worry about the definition of the header, and instead isolate that to the call into the "content negotiation mechanism that the implementation supports". Then headers like DPR can define for themselves how they react to responses that are invalid by including multiple header instances.

@mnot mnot closed this as completed in 484b05a Jul 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants