<!--
Thanks for opening an issue! A few things to keep in mind:

- The issue tracker is only for bugs and feature requests.
- Before reporting a bug, please try reproducing your issue against
  the latest version of Electron.
- If you need general advice, join our Slack: http://atom-slack.herokuapp.com
-->

@deepak1556 This is the issue I mentioned on Slack, thanks for your help!

* Electron version: v1.6.6
* Operating system: OSX 10.12.4

### Expected behavior

Service worker scripts should successfully load after defining a custom protocol interception on `file`. 

### Actual behavior

After defining an intercept function on `file` protocol by calling `interceptBufferProtocol`, service worker scripts fail to load with the error:

```
error when registering service worker TypeError: Failed to register a ServiceWorker: A bad HTTP response code (-1) was received when fetching the script. 
```

This occurs after a call to `interceptBufferProtocol` in the `electron-compile` npm package (in `lib/protocol-hook.js`. If this call is taken out or `protocol.uninterceptProtocol('file');` is called afterward, service worker scripts load correctly.

### How to reproduce

```
git clone https://github.com/concreted/esw -b test_electron_compile
npm install
electron .
```

You should see the `error when registering...` error in the browser window console.
<!-- 

Your best chance of getting this bug looked at quickly is to provide a REPOSITORY that can be cloned and run.

You can fork https://github.com/electron/electron-quick-start and include a link to the branch with your changes.

If you provide a URL, please list the commands required to clone/setup/run your repo e.g.

  $ git clone $YOUR_URL -b $BRANCH
  $ npm install
  $ npm start || electron .

-->

atom/browser/net/url_request_buffer_job.cc
const base::BinaryValue* binary = nullptr;
  if (options->IsType(base::Value::Type::DICTIONARY)) {
    base::DictionaryValue* dict =
        static_cast<base::DictionaryValue*>(options.get());
    dict->GetString("mimeType", &mime_type_);
    dict->GetString("charset", &charset_);
    dict->GetBinary("data", &binary);
  } else if (options->IsType(base::Value::Type::BINARY)) {
    options->GetAsBinary(&binary);
  }
  if (mime_type_.empty()) {
    std::string ext = GetExtFromURL(request()->url());
#if defined(OS_WIN)
    net::GetWellKnownMimeTypeFromExtension(base::UTF8ToUTF16(ext), &mime_type_);
#else
    net::GetWellKnownMimeTypeFromExtension(ext, &mime_type_);
#endif
  }
  if (!binary) {
    NotifyStartError(net::URLRequestStatus(
          net::URLRequestStatus::FAILED, net::ERR_NOT_IMPLEMENTED));
    return;
  }
  data_ = new base::RefCountedBytes(
      reinterpret_cast<const unsigned char*>(binary->GetBuffer()),
      binary->GetSize());
  status_code_ = net::HTTP_OK;
  net::URLRequestSimpleJob::Start();
}
void URLRequestBufferJob::GetResponseInfo(net::HttpResponseInfo* info) {