diff --git a/mod/provider/cloudfront.js b/mod/provider/cloudfront.js index 5dd0ff28ec..d522ea6009 100644 --- a/mod/provider/cloudfront.js +++ b/mod/provider/cloudfront.js @@ -10,6 +10,8 @@ const { getSignedUrl } = require('@aws-sdk/cloudfront-signer'); const logger = require('../utils/logger') +const nodeFetch = require('node-fetch') + module.exports = async ref => { try { @@ -34,7 +36,7 @@ module.exports = async ref => { return signedURL; } - const response = await fetch(signedURL) + const response = await nodeFetch(signedURL) logger(`${response.status} - ${url}`,'cloudfront') @@ -42,6 +44,8 @@ module.exports = async ref => { if (url.match(/\.json$/i)) return await response.json() + if (ref.params.buffer) return await response.buffer() + return await response.text() } catch(err) {