mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Fixed issues with imageblobblur and typo in io.js
This commit is contained in:
@@ -1125,9 +1125,13 @@ router.route('/api/color').post(function(req, res) {
|
||||
|
||||
router.route('/api/imageblob').post(function(req, res) {
|
||||
var Jimp = require("jimp");
|
||||
var origin = req.get("origin").replace("https://", "").replace("http://", "");
|
||||
var allowed = ["client.localhost", "localhost", "zoff.me", "client.zoff.me", "zoff.no", "client.zoff.no"];
|
||||
if(allowed.indexOf(origin) < 0) {
|
||||
try {
|
||||
var origin = req.get("origin").replace("https://", "").replace("http://", "");
|
||||
var allowed = ["client.localhost", "localhost", "zoff.me", "client.zoff.me", "zoff.no", "client.zoff.no"];
|
||||
if(allowed.indexOf(origin) < 0) {
|
||||
throw "Wrong origin";
|
||||
}
|
||||
} catch(e) {
|
||||
res.sendStatus(403);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user