mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Adding polyfill to Headers.getAll to make it work both with the current and past spec. (#723)
This commit is contained in:
parent
c19b82dfe2
commit
f8986cfd92
|
@ -16,7 +16,9 @@ self.addEventListener('activate', (e) => {
|
|||
})
|
||||
|
||||
self.addEventListener('fetch', (e) => {
|
||||
for (const a of e.request.headers.getAll('accept')) {
|
||||
const h = e.request.headers
|
||||
const accept = h.getAll ? h.getAll('accept') : h.get('accept').split(',')
|
||||
for (const a of accept) {
|
||||
// bypass Server Sent Events
|
||||
if (a === 'text/event-stream') return
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue