revert proxy settings

This commit is contained in:
Kasper Rynning-Tønnesen
2015-11-20 18:08:56 +01:00
parent bec733015f
commit 41158df022

View File

@@ -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;