From 41158df022f4cbf890b9943384b94147f3db1d16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Rynning-T=C3=B8nnesen?= Date: Fri, 20 Nov 2015 18:08:56 +0100 Subject: [PATCH] revert proxy settings --- server/node_modules/cors-anywhere/lib/cors-anywhere.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/node_modules/cors-anywhere/lib/cors-anywhere.js b/server/node_modules/cors-anywhere/lib/cors-anywhere.js index 51d55787..597ce31b 100755 --- a/server/node_modules/cors-anywhere/lib/cors-anywhere.js +++ b/server/node_modules/cors-anywhere/lib/cors-anywhere.js @@ -226,12 +226,13 @@ var getHandler = exports.getHandler = function(options, proxy) { }; return function(req, res) { - if(req.headers.referer && req.headers.referer.substring(0,14) !== "http://zoff.no") + /*if(req.headers.referer && req.headers.referer.substring(0,14) !== "http://zoff.no") { res.writeHead(401, "You're accessing the cors-anywhere from wrong domain, only http://zoff.no is allowed"); res.end(); return; } +*/ var cors_headers = withCORS({}, req); if (req.method == 'OPTIONS') { // Pre-flight request. Reply successfully: @@ -263,11 +264,11 @@ var getHandler = exports.getHandler = function(options, proxy) { return; } - /*if (!hasRequiredHeaders(req.headers)) { + if (!hasRequiredHeaders(req.headers)) { res.writeHead(400, 'Header required', cors_headers); res.end('Missing required request header. Must specify one of: ' + corsAnywhere.requireHeader); return; - }*/ + } var isRequestedOverHttps = req.connection.encrypted || /^\s*https/.test(req.headers['x-forwarded-proto']); var proxyBaseUrl = (isRequestedOverHttps ? 'https://' : 'http://') + req.headers.host;