Skip to content

Commit 746a146

Browse files
committed
Add Last-Event-ID to CORS-safelisted headers
The EventSource API does _not_ run any preflight request when specifying the `Last-Event-ID` header, and so `fetch` requests should also allow this header to be set manually. See whatwg/fetch#568 for more information
1 parent 0177fdb commit 746a146

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

fetch/api/cors/cors-no-preflight.any.js

+2
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,5 @@ corsNoPreflight("Cross domain [GET] [Content-Type: multipart/form-data]", host_i
3939
corsNoPreflight("Cross domain [GET] [Content-Type: text/plain]", host_info.HTTP_REMOTE_ORIGIN, "GET" , "Content-Type", "text/plain");
4040
corsNoPreflight("Cross domain [GET] [Content-Type: text/plain;charset=utf-8]", host_info.HTTP_REMOTE_ORIGIN, "GET" , "Content-Type", "text/plain;charset=utf-8");
4141
corsNoPreflight("Cross domain [GET] [Content-Type: Text/Plain;charset=utf-8]", host_info.HTTP_REMOTE_ORIGIN, "GET" , "Content-Type", "Text/Plain;charset=utf-8");
42+
corsNoPreflight("Cross domain [GET] [Last-Event-ID: evt-14]", host_info.HTTP_REMOTE_ORIGIN, "GET", "Last-Event-ID", "evt-14");
43+
corsNoPreflight("Cross domain [GET] [Last-Event-ID: EvT-15]", host_info.HTTP_REMOTE_ORIGIN, "GET", "Last-Event-ID", "EvT-15");

fetch/api/cors/resources/not-cors-safelisted.json

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
["content-language", "@"],
99
["content-type", "text/html"],
1010
["content-type", "text/plain; long=0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901"],
11+
["last-event-id", "\""],
12+
["lsat-event-id", "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678"],
1113
["range", "bytes 0-"],
1214
["test", "hi"]
1315
]

0 commit comments

Comments
 (0)