diff --git a/src/hkp.js b/src/hkp.js index 9d181223..492d68a0 100644 --- a/src/hkp.js +++ b/src/hkp.js @@ -32,7 +32,7 @@ import config from './config'; */ function HKP(keyServerBaseUrl) { this._baseUrl = keyServerBaseUrl || config.keyserver; - this._fetch = typeof global !== 'undefined' ? global.fetch : require('node-fetch'); + this._fetch = typeof global.fetch === 'function' ? global.fetch : require('node-fetch'); } /**