From 42abb809f65c0aaf4b906cd78fc0661358f4b0b1 Mon Sep 17 00:00:00 2001 From: Julian Simioni Date: Wed, 2 Sep 2015 12:56:56 -0400 Subject: [PATCH] Disable proxy if legacyUrl config entry is missing --- routes/legacy.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/routes/legacy.js b/routes/legacy.js index e810ad0e..00e859d8 100644 --- a/routes/legacy.js +++ b/routes/legacy.js @@ -1,6 +1,10 @@ var proxy = require('express-http-proxy'); function addRoutes(app, peliasConfig) { + if (!peliasConfig.hasOwnProperty('legacyUrl')) { + return; + } + var sendToLegacy = proxy(peliasConfig.legacyUrl, { forwardPath: function(req, res) { return require('url').parse(req.url).path;