@@ -456,6 +456,8 @@ <h4 id="terminology-headers"><span class="secno">3.1.2 </span>Headers</h4>
456
456
< p > and whose < a href ="#concept-header-value " title ="concept-header-value "> value</ a > ,
457
457
< a href ="#concept-header-parse " title ="concept-header-parse "> once parsed</ a > , is not a failure.
458
458
459
+ < p > A < dfn id ="cors-non-wildcard-request-header-name "> CORS non-wildcard request-header name</ dfn > is `< code title =""> Authorization</ code > `.
460
+
459
461
< p > A < dfn id ="cors-safelisted-response-header-name "> CORS-safelisted response-header name</ dfn > , given a
460
462
< a href ="#concept-response-cors-exposed-header-name-list " title ="concept-response-cors-exposed-header-name-list "> CORS-exposed header-name list</ a >
461
463
< var > list</ var > , is a < a href ="#concept-header " title ="concept-header "> header</ a >
@@ -1857,12 +1859,14 @@ <h4 id="http-new-header-syntax"><span class="secno">4.2.4 </span>HTTP new-header
1857
1859
< pre > Access-Control-Request-Method = < a class ="external " data-anolis-spec ="http " href ="https://tools.ietf.org/html/rfc7230#section-3.1.1 "> method</ a >
1858
1860
Access-Control-Request-Headers = #< a class ="external " data-anolis-spec ="http " href ="https://tools.ietf.org/html/rfc7230#section-3.2 "> field-name</ a >
1859
1861
1860
- Access-Control-Allow-Origin = origin-or-null / "*"
1862
+ wilrdcard = "*"
1863
+ Access-Control-Allow-Origin = origin-or-null / wildcard
1861
1864
Access-Control-Allow-Credentials = %x74.72.75.65 ; "true", case-sensitive
1862
- Access-Control-Expose-Headers = #< a class ="external " data-anolis-spec ="http " href ="https://tools.ietf.org/html/rfc7230#section-3.2 "> field-name</ a >
1865
+ Access-Control-Expose-Headers = field-name-or-wildcard
1866
+ field-name-or-wildcard = < a class ="external " data-anolis-spec ="http " href ="https://tools.ietf.org/html/rfc7230#section-3.2 "> field-name</ a > / wildcard
1863
1867
Access-Control-Max-Age = < a class ="external " data-anolis-spec ="http-caching " href ="https://tools.ietf.org/html/rfc7234#section-1.2.1 "> delta-seconds</ a >
1864
- Access-Control-Allow-Methods = #< a class ="external " data-anolis-spec ="http " href ="https://tools.ietf.org/html/rfc7230#section-3.1.1 "> method</ a >
1865
- Access-Control-Allow-Headers = #< a class =" external " data-anolis-spec =" http " href =" https://tools.ietf.org/html/rfc7230#section-3.2 " > field-name</ a > </ pre >
1868
+ Access-Control-Allow-Methods = #< a class ="external " data-anolis-spec ="http " href ="https://tools.ietf.org/html/rfc7230#section-3.1.1 "> method</ a > / wildcard
1869
+ Access-Control-Allow-Headers = #field-name-or-wildcard </ pre >
1866
1870
1867
1871
1868
1872
< h4 id ="cors-protocol-and-credentials "> < span class ="secno "> 4.2.5 </ span > CORS protocol and credentials</ h4 >
@@ -1964,6 +1968,13 @@ <h4 id="cors-protocol-and-credentials"><span class="secno">4.2.5 </span>CORS pro
1964
1968
< td > `< code > true</ code > ` is (byte) case-sensitive.
1965
1969
</ table >
1966
1970
1971
+ < p > Similarly, `< a href ="#http-access-control-expose-headers "> < code title ="http-access-control-expose-headers "> Access-Control-Expose-Headers</ code > </ a > `,
1972
+ `< a href ="#http-access-control-allow-methods "> < code title ="http-access-control-allow-methods "> Access-Control-Allow-Methods</ code > </ a > `, and
1973
+ `< a href ="#http-access-control-allow-headers "> < code title ="http-access-control-allow-headers "> Access-Control-Allow-Headers</ code > </ a > ` response
1974
+ headers can only use `< code > *</ code > ` as value when < a href ="#concept-request " title ="concept-request "> request</ a > 's
1975
+ < a href ="#concept-request-credentials-mode " title ="concept-request-credentials-mode "> credentials mode</ a > is not "< code > include</ code > ".
1976
+
1977
+
1967
1978
< h4 id ="cors-protocol-examples "> < span class ="secno "> 4.2.6 </ span > Examples</ h4 >
1968
1979
1969
1980
< div class ="example ">
@@ -2452,13 +2463,29 @@ <h3 id="main-fetch"><span class="secno">5.1 </span>Main fetch</h3>
2452
2463
run these substeps:
2453
2464
2454
2465
< ol >
2455
- < li > < p > If < var > request</ var > 's
2456
- < a href ="#concept-request-response-tainting " title ="concept-request-response-tainting "> response tainting</ a > is
2457
- "< code title =""> cors</ code > ", then set < var > response</ var > 's
2458
- < a href ="#concept-response-cors-exposed-header-name-list " title ="concept-response-cors-exposed-header-name-list "> CORS-exposed header-name list</ a >
2459
- to the result of < a href ="#concept-header-parse " title ="concept-header-parse "> parsing</ a >
2460
- `< a href ="#http-access-control-expose-headers "> < code title ="http-access-control-expose-headers "> Access-Control-Expose-Headers</ code > </ a > ` in
2461
- < var > response</ var > 's < a href ="#concept-response-header-list " title ="concept-response-header-list "> header list</ a > .
2466
+ < li >
2467
+ < p > If < var > request</ var > 's
2468
+ < a href ="#concept-request-response-tainting " title ="concept-request-response-tainting "> response tainting</ a > is
2469
+ "< code title =""> cors</ code > ", then run these substeps:</ p >
2470
+
2471
+ < ol >
2472
+ < li > < p > Let < var > headerNames</ var > be the result < a href ="#concept-header-parse " title ="concept-header-parse "> parsing</ a >
2473
+ `< a href ="#http-access-control-expose-headers "> < code title ="http-access-control-expose-headers "> Access-Control-Expose-Headers</ code > </ a > ` in
2474
+ < var > response</ var > 's < a href ="#concept-response-header-list " title ="concept-response-header-list "> header list</ a > .
2475
+
2476
+ < li > < p > If < var > headerNames</ var > contains `< code title =""> *</ code > ` and < var > request</ var > 's
2477
+ < a href ="#concept-request-credentials-mode " title ="concept-request-credentials-mode "> credentials mode</ a > is not
2478
+ "< code > include</ code > ", then set < var > response</ var > 's
2479
+ < a href ="#concept-response-cors-exposed-header-name-list " title ="concept-response-cors-exposed-header-name-list "> CORS-exposed header-name list</ a >
2480
+ to all unique < a href ="#concept-header " title ="concept-header "> header</ a >
2481
+ < a href ="#concept-header-name " title ="concept-header-name "> names</ a > in < var > response</ var > 's
2482
+ < a href ="#concept-response-header-list " title ="concept-response-header-list "> header list</ a > .</ li >
2483
+
2484
+ < li > < p > Otherwise, if < var > headerNames</ var > does < em > not</ em > contain `< code title =""> *</ code > `,
2485
+ then set < var > response</ var > 's
2486
+ < a href ="#concept-response-cors-exposed-header-name-list " title ="concept-response-cors-exposed-header-name-list "> CORS-exposed header-name list</ a >
2487
+ to < var > headerNames</ var > .</ p >
2488
+ </ ol >
2462
2489
2463
2490
< li >
2464
2491
< p > Set < var > response</ var > to the following
@@ -3630,9 +3657,21 @@ <h3 id="cors-preflight-fetch"><span class="secno">5.7 </span>CORS-preflight fetc
3630
3657
< li > < p > If either < var > methods</ var > or < var > headerNames</ var > is failure,
3631
3658
return a < a href ="#concept-network-error " title ="concept-network-error "> network error</ a > .
3632
3659
3660
+ < li > < p > If < var > methods</ var > is `< code > *</ code > ` or < var > headerNames</ var > contains
3661
+ `< code > *</ code > `, and < var > request</ var > 's
3662
+ < a href ="#concept-request-credentials-mode " title ="concept-request-credentials-mode "> credentials mode</ a > is "< code > include</ code > ",
3663
+ then return a < a href ="#concept-network-error " title ="concept-network-error "> network error</ a > .
3664
+
3633
3665
< li >
3634
- < p > If < var > methods</ var > is null and < var > request</ var > 's < a href ="#use-cors-preflight-flag "> use-CORS-preflight flag</ a >
3635
- is set, set < var > methods</ var > to < var > request</ var > 's
3666
+ < p > If one of the following is true
3667
+
3668
+ < ul class ="brief ">
3669
+ < li > < var > methods</ var > is null and < var > request</ var > 's < a href ="#use-cors-preflight-flag "> use-CORS-preflight flag</ a > is
3670
+ set
3671
+ < li > < var > methods</ var > is `< code > *</ code > `
3672
+ </ ul >
3673
+
3674
+ < p > then set < var > methods</ var > to a new list containing < var > request</ var > 's
3636
3675
< a href ="#concept-request-method " title ="concept-request-method "> method</ a > .
3637
3676
3638
3677
< p class ="note no-backref "> This ensures that a < a href ="#cors-preflight-fetch-0 "> CORS-preflight fetch</ a > that
@@ -3643,6 +3682,18 @@ <h3 id="cors-preflight-fetch"><span class="secno">5.7 </span>CORS-preflight fetc
3643
3682
is not in < var > methods</ var > and is not a < a href ="#simple-method "> simple method</ a > , return a
3644
3683
< a href ="#concept-network-error " title ="concept-network-error "> network error</ a > .
3645
3684
3685
+ < li > < p > If one of < var > request</ var > 's
3686
+ < a href ="#concept-request-header-list " title ="concept-request-header-list "> header list</ a > 's
3687
+ < a href ="#concept-header-name " title ="concept-header-name "> names</ a > is a
3688
+ < a href ="#cors-non-wildcard-request-header-name "> CORS non-wildcard request-header name</ a > and is not in < var > headerNames</ var > , then
3689
+ return a < a href ="#concept-network-error " title ="concept-network-error "> network error</ a > .
3690
+
3691
+ < li > < p > If < var > headerNames</ var > contains `< code > *</ code > `, then remove all occurances of
3692
+ `< code > *</ code > ` from < var > headerNames</ var > and append all unique
3693
+ < a href ="#concept-header " title ="concept-header "> header</ a > < a href ="#concept-header-name " title ="concept-header-name "> names</ a > from
3694
+ < var > request</ var > 's < a href ="#concept-request-header-list " title ="concept-request-header-list "> header list</ a > to
3695
+ < var > headerNames</ var > .
3696
+
3646
3697
< li > < p > If one of < var > request</ var > 's
3647
3698
< a href ="#concept-request-header-list " title ="concept-request-header-list "> header list</ a > '
3648
3699
< a href ="#concept-header-name " title ="concept-header-name "> names</ a > is not in < var > headerNames</ var > and
@@ -5522,6 +5573,7 @@ <h2 class="no-num" id="acknowledgments">Acknowledgments</h2>
5522
5573
Clement Pellerin,
5523
5574
Collin Jackson,
5524
5575
Daniel Robertson,
5576
+ Daniel Veditz,
5525
5577
David Håsäther,
5526
5578
David Orchard,
5527
5579
Domenic Denicola,
0 commit comments