1
0
mirror of https://git.tuxpa.in/a/code-server.git synced 2024-12-29 13:38:46 +00:00
code-server-2/test/patches/service-worker-mock-fetch.patch

16 lines
520 B
Diff
Raw Normal View History

2021-02-18 21:35:41 +00:00
--- node_modules/service-worker-mock/fetch.js 2021-02-18 13:47:55.000000000 -0700
+++ patches/service-worker-mock-fixed.js 2021-02-18 15:49:47.000000000 -0700
@@ -1,8 +1,11 @@
module.exports = async (request) => {
+ const Response = require('./models/Response');
const response = new Response('Response from service-worker-mock/fetch.js', {
status: 200,
statusText: 'ok.'
});
- response.url = request.url;
+ if (request && request.url) {
+ response.url = request.url;
+ }
return response;
};