Skip to content

Specify "__Host-" and "__Secure-" prefix failures #259

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

Merged
merged 6 commits into from
May 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1141,15 +1141,18 @@ run the following steps:

ISSUE(httpwg/http-extensions#1593): Note that it's up for discussion whether these character restrictions should also apply to |expires|, |domain|, |path|, and |sameSite| as well.

1. If |name|'s [=string/length=] is 0 and |value| contains U+003D (=), then return failure.
1. If |name|'s [=string/length=] is 0 and |value|'s [=string/length=] is 0, then return failure.
1. If |name|'s [=string/length=] is 0:
1. If |value| contains U+003D (=), then return failure.
1. If |value|'s [=string/length=] is 0, then return failure.
1. If |value|, [=byte-lowercased=], [=byte sequence/starts with=] \``__host-`\` or \``__secure-`\`, then return failure.
1. Let |encodedName| be the result of [=UTF-8 encode|UTF-8 encoding=] |name|.
1. Let |encodedValue| be the result of [=UTF-8 encode|UTF-8 encoding=] |value|.
1. If the [=byte sequence=] [=byte sequence/length=] of |encodedName| plus the [=byte sequence=] [=byte sequence/length=] of |encodedValue| is greater than the <a for=cookie>maximum name/value pair size</a>, then return failure.
1. Let |host| be |url|'s [=url/host=]
1. Let |attributes| be a new [=/list=].
1. If |domain| is not null, then run these steps:
1. If |domain| starts with U+002E (.), then return failure.
1. If |name|, [=byte-lowercased=], [=byte sequence/starts with=] \``__host-`\`, then return failure.
1. If |host| does not equal |domain| and
|host| does not end with U+002E (.) followed by |domain|,
then return failure.
Expand All @@ -1159,6 +1162,7 @@ run the following steps:
1. If |expires| is given, then [=list/append=] \``Expires`\`/|expires| ([=date serialized=]) to |attributes|.
1. If |path| is not null:
1. If |path| does not start with U+002F (/), then return failure.
1. If |path| is not U+002F (/), and |name|, [=byte-lowercased=], [=byte sequence/starts with=] \``__host-`\`, then return failure.
1. Let |encodedPath| be the result of [=UTF-8 encode|UTF-8 encoding=] |path|.
1. If the [=byte sequence=] [=byte sequence/length=] of |encodedPath| is greater than the [=cookie/maximum attribute value size=], then return failure.
1. [=list/Append=] \``Path`\`/|encodedPath| to |attributes|.
Expand Down