Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Commit

Permalink
Parsing algorithm.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikewest committed Jun 20, 2019
1 parent a7433c5 commit ec62f6d
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -159,19 +159,24 @@ To <dfn abstract-op local-lt="parse header">obtain a response's embedder policy<

1. Let |policy| be "`none`".

2. Let |header| be the result of [=extracting header values=] given `Cross-Origin-Embedder-Policy`
and |response|'s [=response/header list=].
2. Let |header| be the result of [=header list/getting=] `Cross-Origin-Embedder-Policy` from
|response|'s [=response/header list=].

3. If |header| is not `null`:

3. If |header| matches the <a grammar>`sh-token`</a> grammar:
1. Set |header| to the result of [=isomorphic decoding=] |header|.

1. Let |parsed policy| be the result of executing the [$Structured Header parsing algorithm$]
2. Let |parsed policy| be the result of executing the [$Structured Header parsing algorithm$]
with <var ignore>input_string</var> set to |header|, and <var ignore>header_type</var> set
to "`item`".

If parsing fails, set |parsed policy| to "`none`".

ISSUE: Not sure if this is the right integration between Fetch's understanding of header
values and Structured Headers.
values and Structured Headers. For example, the latter requires an ASCII string, the former
decodes an ~arbitrary byte sequence.

2. If |parsed policy| is "`require-corp`", set |policy| to "`require-corp`".
3. If |parsed policy| is "`require-corp`", set |policy| to "`require-corp`".

4. Return |policy|.

Expand Down

0 comments on commit ec62f6d

Please sign in to comment.