Skip to content

Commit f8986cf

Browse files
impronunciablerauchg
authored andcommitted
Adding polyfill to Headers.getAll to make it work both with the current and past spec. (#723)
1 parent c19b82d commit f8986cf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

client/next-prefetcher.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ self.addEventListener('activate', (e) => {
1616
})
1717

1818
self.addEventListener('fetch', (e) => {
19-
for (const a of e.request.headers.getAll('accept')) {
19+
const h = e.request.headers
20+
const accept = h.getAll ? h.getAll('accept') : h.get('accept').split(',')
21+
for (const a of accept) {
2022
// bypass Server Sent Events
2123
if (a === 'text/event-stream') return
2224
}

0 commit comments

Comments
 (0)