[ServiceWorker] should respondWith(undefined) be treated the same as not calling respondWith() (#766)

@ehsan debugged the guardian's new service worker on firefox this morning:

  https://bugzilla.mozilla.org/show_bug.cgi?id=1217501

It seems its calling respondWith(undefined) in some circumstances.  Firefox treats this as a NetworkError because undefined is not a Response.  It seems chrome treats respondWth(undefined) the same as not calling respondWith() at all.

What is the desired behavior?

The spec actually says that respondWith(undefined) should return an error.  In respondWith() step 6.3:

> 1) f response is a Response object, then:
>   ...
> 2) else:
>  1) Set the respond-with error flag.

I can see why maybe the chrome behavior would be desired, though.

cc / @jakearchibald

---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/766

Received on Friday, 23 October 2015 14:57:35 UTC