Skip to content

Commit

Permalink
Adding polyfill to Headers.getAll to make it work both with the curre…
Browse files Browse the repository at this point in the history
…nt and past spec. (vercel#723)
  • Loading branch information
impronunciable authored and rauchg committed Jan 10, 2017
1 parent c19b82d commit f8986cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/next-prefetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit f8986cf

Please sign in to comment.