diff --git a/services/cache/mecache/cache.js b/services/cache/mecache/cache.js index 6313acf0..6fc10408 100644 --- a/services/cache/mecache/cache.js +++ b/services/cache/mecache/cache.js @@ -5,6 +5,7 @@ let app = express(); let mcache = require('memory-cache'); const request = require('superagent'); const prom = require('prom-client'); +const URL = require('url'); let cors = require('cors'); app.use(cors()); @@ -38,7 +39,7 @@ let cache = (duration) => { if(req.query.url) { let key = '__express__' + req.query.url; let cachedBody = mcache.get(key); - const url = new URL(req.query.url); + const url = new URL.parse(req.query.url); const target = url.host + '/' + url.pathname.split('/')[1]; const scheme = url.protocol.replace(':', ''); if (cachedBody) {