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
Change how CORS filtered response filters the headers. #265
Closed
mkruisselbrink
wants to merge
4
commits into
whatwg:master
from
mkruisselbrink:change-cors-header-filtering
Closed
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
8c2a9dd
Change how CORS filtered response filters the headers.
mkruisselbrink 0de4b98
Fix generated html in source, and add note describing CORS-exposed he…
mkruisselbrink 25a6c07
Have substeps for setting CORS-exposed header-name list and creating …
mkruisselbrink d3de0ae
Only set CORS-exposed header-name list when tainting is "cors".
mkruisselbrink File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -382,7 +382,7 @@ <h4 id=terminology-headers>Headers</h4> | |
</ul> | ||
|
||
<p>A <dfn>CORS-safelisted response-header name</dfn>, given a | ||
<span title=concept-response-header-list>header list</span> <var>list</var>, is a | ||
<span title=concept-response-cors-exposed-header-name-list>CORS-exposed header-name list</span> <var>list</var>, is a | ||
<span title=concept-header>header</span> <span title=concept-header-name>name</span> that is one of: | ||
|
||
<ul> | ||
|
@@ -392,9 +392,7 @@ <h4 id=terminology-headers>Headers</h4> | |
<li>`<code title>Expires</code>` | ||
<li>`<code title>Last-Modified</code>` | ||
<li>`<code title>Pragma</code>`. | ||
<li>Any <span title=concept-header-value>value</span> resulting from | ||
<span title=concept-header-parse>parsing</span> | ||
`<code title=http-access-control-expose-headers>Access-Control-Expose-Headers</code>` in | ||
<li>Any <span title=concept-header-value>value</span> in | ||
<var>list</var> that is not a <span>forbidden response-header name</span>. | ||
</ul> | ||
|
||
|
@@ -1042,6 +1040,19 @@ <h4>Responses</h4> | |
for the <span title=concept-response>response</span>. The list is empty unless otherwise | ||
specified. <span data-anolis-ref>CSP</span> | ||
|
||
<p>A <span title=concept-response>response</span> has an associated | ||
<dfn title=concept-response-cors-exposed-header-name-list>CORS-exposed header-name list</dfn> | ||
(a list of zero or more | ||
<span title=concept-header>header</span> <span title=concept-header-name>names</span>). | ||
The list is empty unless otherwise specified. | ||
|
||
<p class="note no-backref">A <span title=concept-response>response</span> will typically get its | ||
<span title=concept-response-cors-exposed-header-name-list>CORS-exposed header-name list</span> | ||
set by <span title=concept-header-parse>parsing</span> the | ||
`<code title=http-access-control-expose-headers>Access-Control-Expose-Headers</code>` header. This | ||
list is used by a <span title=concept-filtered-response-cors>CORS filtered response</span> to | ||
determine which headers to expose. | ||
|
||
<hr> | ||
|
||
<p>A <span title=concept-response>response</span> whose | ||
|
@@ -1093,7 +1104,7 @@ <h4>Responses</h4> | |
<span title=concept-header-name>name</span> is <em>not</em> a | ||
<span>CORS-safelisted response-header name</span>, given | ||
<span title=concept-internal-response>internal response</span>'s | ||
<span title=concept-response-header-list>header list</span>. | ||
<span title=concept-response-cors-exposed-header-name-list>CORS-exposed header-name list</span>. | ||
|
||
<p>An <dfn title=concept-filtered-response-opaque>opaque filtered response</dfn> is a | ||
<span title=concept-filtered-response>filtered response</span> whose | ||
|
@@ -2035,22 +2046,34 @@ <h3>Main fetch</h3> | |
<p>If <var>response</var> is not a | ||
<span title=concept-network-error>network error</span> and | ||
<var>response</var> is not a | ||
<span title=concept-filtered-response>filtered response</span>, set | ||
<var>response</var> to the following | ||
<span title=concept-filtered-response>filtered response</span> with | ||
<var>response</var> as its | ||
<span title=concept-internal-response>internal response</span>, depending on | ||
<var>request</var>'s | ||
<span title=concept-request-response-tainting>response tainting</span>: | ||
|
||
<dl class="switch compact"> | ||
<dt>"<code title>basic</code>" | ||
<dd><span title=concept-filtered-response-basic>basic filtered response</span> | ||
<dt>"<code title>cors</code>" | ||
<dd><span title=concept-filtered-response-cors>CORS filtered response</span> | ||
<dt>"<code title>opaque</code>" | ||
<dd><span title=concept-filtered-response-opaque>opaque filtered response</span> | ||
</dl> | ||
<span title=concept-filtered-response>filtered response</span>, run these substeps: | ||
|
||
<ol> | ||
<li> | ||
<p>Set <var>response</var>'s | ||
<span title=concept-response-cors-exposed-header-name-list>CORS-exposed header-name list</span> | ||
to the result of <span title=concept-header-parse>parsing</span> | ||
`<code title=http-access-control-expose-headers>Access-Control-Expose-Headers</code>` in | ||
<var>response</var>'s | ||
<span title=concept-response-header-list>header list</span>. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Although it does not matter in a black-box-observable way, I still think we should add a conditional here for response tainting being "cors". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
|
||
<li> | ||
<p>Set <var>response</var> to the following | ||
<span title=concept-filtered-response>filtered response</span> with | ||
<var>response</var> as its | ||
<span title=concept-internal-response>internal response</span>, depending on | ||
<var>request</var>'s | ||
<span title=concept-request-response-tainting>response tainting</span>: | ||
|
||
<dl class="switch compact"> | ||
<dt>"<code title>basic</code>" | ||
<dd><span title=concept-filtered-response-basic>basic filtered response</span> | ||
<dt>"<code title>cors</code>" | ||
<dd><span title=concept-filtered-response-cors>CORS filtered response</span> | ||
<dt>"<code title>opaque</code>" | ||
<dd><span title=concept-filtered-response-opaque>opaque filtered response</span> | ||
</dl> | ||
</ol> | ||
|
||
<li><p>Let <var>internalResponse</var> be <var>response</var>, if <var>response</var> is a | ||
<span title=concept-network-error>network error</span>, and <var>response</var>'s | ||
|
@@ -5047,6 +5070,7 @@ <h2 class=no-num>Acknowledgments</h2> | |
Manish Goregaokar, | ||
Marc Silbey, | ||
Marcos Caceres, | ||
Marijn Kruisselbrink, | ||
Mark Nottingham, | ||
Mark S. Miller, | ||
Martin Dürst, | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a note here that says this is only used for CORS filtered responses?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a note explaining what this is and what it's used for.