Bug 1263373 - Don't respondWith twice in fetch-rewrite-worker.js r=bkelly
authorCatalin Badea <catalin.badea392@gmail.com>
Fri, 11 Nov 2016 00:07:15 +0200
changeset 322142 85bef7bdcafc1d93dd4ec86775c63771617f4acd
parent 322141 829e818cd4c3d7aa0431cedef21d2b0a972fb503
child 322143 db092219b8711982cfceb5b6bdb4d00fb6700ab8
push id21
push usermaklebus@msu.edu
push dateThu, 01 Dec 2016 06:22:08 +0000
reviewersbkelly
bugs1263373
milestone52.0a1
Bug 1263373 - Don't respondWith twice in fetch-rewrite-worker.js r=bkelly
testing/web-platform/tests/service-workers/service-worker/resources/fetch-rewrite-worker.js
--- a/testing/web-platform/tests/service-workers/service-worker/resources/fetch-rewrite-worker.js
+++ b/testing/web-platform/tests/service-workers/service-worker/resources/fetch-rewrite-worker.js
@@ -71,16 +71,17 @@ self.addEventListener('fetch', function(
     }
     if (params['check-accept-header']) {
       var accept = event.request.headers.get('Accept');
       if (accept) {
         event.respondWith(new Response(accept));
       } else {
         event.respondWith(new Response('NO_ACCEPT'));
       }
+      return;
     }
     event.respondWith(new Promise(function(resolve, reject) {
         var request = event.request;
         if (url) {
           request = new Request(url, init);
         }
         fetch(request).then(function(response) {
           var expectedType = params['expected_type'];