Skip to content

Commit

Permalink
bypass SSE on Service Worker (#681)
Browse files Browse the repository at this point in the history
  • Loading branch information
nkzawa authored and rauchg committed Jan 6, 2017
1 parent 13feb88 commit 0551dc9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client/next-prefetcher.js
Expand Up @@ -16,6 +16,11 @@ self.addEventListener('activate', (e) => {
})

self.addEventListener('fetch', (e) => {
for (const a of e.request.headers.getAll('accept')) {
// bypass Server Sent Events
if (a === 'text/event-stream') return
}

e.respondWith(getResponse(e.request))
})

Expand Down

0 comments on commit 0551dc9

Please sign in to comment.