mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
revert proxy settings
This commit is contained in:
7
server/node_modules/cors-anywhere/lib/cors-anywhere.js
generated
vendored
7
server/node_modules/cors-anywhere/lib/cors-anywhere.js
generated
vendored
@@ -226,12 +226,13 @@ var getHandler = exports.getHandler = function(options, proxy) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return function(req, res) {
|
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.writeHead(401, "You're accessing the cors-anywhere from wrong domain, only http://zoff.no is allowed");
|
||||||
res.end();
|
res.end();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
var cors_headers = withCORS({}, req);
|
var cors_headers = withCORS({}, req);
|
||||||
if (req.method == 'OPTIONS') {
|
if (req.method == 'OPTIONS') {
|
||||||
// Pre-flight request. Reply successfully:
|
// Pre-flight request. Reply successfully:
|
||||||
@@ -263,11 +264,11 @@ var getHandler = exports.getHandler = function(options, proxy) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if (!hasRequiredHeaders(req.headers)) {
|
if (!hasRequiredHeaders(req.headers)) {
|
||||||
res.writeHead(400, 'Header required', cors_headers);
|
res.writeHead(400, 'Header required', cors_headers);
|
||||||
res.end('Missing required request header. Must specify one of: ' + corsAnywhere.requireHeader);
|
res.end('Missing required request header. Must specify one of: ' + corsAnywhere.requireHeader);
|
||||||
return;
|
return;
|
||||||
}*/
|
}
|
||||||
|
|
||||||
var isRequestedOverHttps = req.connection.encrypted || /^\s*https/.test(req.headers['x-forwarded-proto']);
|
var isRequestedOverHttps = req.connection.encrypted || /^\s*https/.test(req.headers['x-forwarded-proto']);
|
||||||
var proxyBaseUrl = (isRequestedOverHttps ? 'https://' : 'http://') + req.headers.host;
|
var proxyBaseUrl = (isRequestedOverHttps ? 'https://' : 'http://') + req.headers.host;
|
||||||
|
|||||||
Reference in New Issue
Block a user