Securing cors

This commit is contained in:
Kasper Rynning-Tønnesen
2015-11-28 18:23:43 +01:00
parent 9bc89fd824
commit 05d57a5b7b
3 changed files with 4 additions and 4 deletions

View File

@@ -226,13 +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,15) !== "https://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: