Opaque being-loaded responses should clone their body
[WebKit-https.git] / LayoutTests / http / wpt / service-workers / clone-opaque-being-loaded-response-worker.js
1 importScripts('/common/get-host-info.sub.js');
2
3 var remoteUrl = get_host_info()['HTTPS_REMOTE_ORIGIN'] + '/WebKit/service-workers/resources/lengthy-pass.py';
4
5 self.addEventListener('fetch', (event) => {
6     if (event.request.url.indexOf("html") === -1)
7         event.respondWith(fetch(remoteUrl, {mode: 'no-cors'}).then(response => response.clone()));
8 });