Skip to content

Commit

Permalink
Merge branch 'main' of github.com:mnot/I-D
Browse files Browse the repository at this point in the history
  • Loading branch information
mnot committed May 3, 2024
2 parents 0fc7204 + 72babad commit 9705dcd
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions draft-nottingham-http-availability-hints.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,20 +180,20 @@ The Cookie-Indices response header field is the availability hint for content ne

~~~ http-message
Vary: Cookie
Cookie-Indices: id, sid
Cookie-Indices: "id", "sid"
~~~

Cookie-Indicies is a Structured Field, whose value is a List ({{Section 3.1 of STRUCTURED-FIELDS}}) of Tokens ({{Section 3.3.4 of STRUCTURED-FIELDS}}). Each list item indicates a cookie name whose value is to be considered when selecting responses.
Cookie-Indices is a Structured Field, whose value is a List ({{Section 3.1 of STRUCTURED-FIELDS}}) of Strings ({{Section 3.3.3 of STRUCTURED-FIELDS}}). Each list item indicates a cookie name whose value is to be considered when selecting responses.

The selection algorithm for Cookie-Indices, given a set of stored_responses a presented_request, and the value of Cookie-Indices:

0. Let available_responses be an empty set.
1. For each stored_response in stored_responses:
1. For each cookie_index in Cookie-Indicies:
1. Let presented_value be the value of the cookie with the name cookie_index in presented_request. If a cookie with the name cookie_index is not present in presented_request, let presented_value be a null value.
2. Let stored_value be the value of the cookie with the name cookie_index in stored_response. If a cookie with the name cookie_index is not present in stored_response, let stored_value be a null value.
3. If presented_value does not equal stored_value, continue to the next stored_response.
2. Add stored_response to available_responses.
1. For each cookie_index in Cookie-Indices:
1. Let presented_value be the value of the cookie with the name cookie_index in presented_request. If a cookie with the name cookie_index is not present in presented_request, let presented_value be a null value.
2. Let stored_value be the value of the cookie with the name cookie_index in stored_response. If a cookie with the name cookie_index is not present in stored_response, let stored_value be a null value.
3. If presented_value does not equal stored_value, continue to the next stored_response.
2. Add stored_response to available_responses.
2. Return available_responses.

Note that this algorithm requires storing the cookies from the associated request with each response.
Expand Down Expand Up @@ -248,4 +248,3 @@ TBD


--- back

0 comments on commit 9705dcd

Please sign in to comment.