1 | ;
|
2 |
|
3 | var realFetch = require('node-fetch');
|
4 | module.exports = function(url, options) {
|
5 | if (/^\/\//.test(url)) {
|
6 | url = 'https:' + url;
|
7 | }
|
8 | return realFetch.call(this, url, options);
|
9 | };
|
10 |
|
11 | if (!global.fetch) {
|
12 | global.fetch = module.exports;
|
13 | global.Response = realFetch.Response;
|
14 | global.Headers = realFetch.Headers;
|
15 | global.Request = realFetch.Request;
|
16 | }
|