From 6ce72e77bf2d1026bb754d5aca3828d7714798bb Mon Sep 17 00:00:00 2001 From: Matthew Andrews Date: Wed, 15 Apr 2015 14:11:12 +0100 Subject: [PATCH] Don't redefine global fetch. --- server.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index a5896be..3be036d 100644 --- a/server.js +++ b/server.js @@ -1,9 +1,13 @@ "use strict"; var realFetch = require('node-fetch'); -module.exports = global.fetch = function(url, options) { +module.exports = function(url, options) { if (/^\/\//.test(url)) { url = 'https:' + url; } return realFetch.call(this, url, options); }; + +if (!global.fetch) { + global.fetch = module.exports; +}