Commit f8986cfd authored by Dan Zajdband's avatar Dan Zajdband Committed by Guillermo Rauch

Adding polyfill to Headers.getAll to make it work both with the current and past spec. (#723)

parent c19b82df
...@@ -16,7 +16,9 @@ self.addEventListener('activate', (e) => { ...@@ -16,7 +16,9 @@ self.addEventListener('activate', (e) => {
}) })
self.addEventListener('fetch', (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 // bypass Server Sent Events
if (a === 'text/event-stream') return if (a === 'text/event-stream') return
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment