mirror of https://gitee.com/bigwinds/arangodb
fix app thumbnails
This commit is contained in:
parent
7bd9f03cb1
commit
96d8c24c61
|
@ -211,11 +211,12 @@
|
||||||
res.transformations = [ "base64decode" ];
|
res.transformations = [ "base64decode" ];
|
||||||
var mount = validateMount(req);
|
var mount = validateMount(req);
|
||||||
var app = FoxxManager.lookupApp(mount);
|
var app = FoxxManager.lookupApp(mount);
|
||||||
if (app.hasOwnProperty("thumbnail")) {
|
if (app.hasOwnProperty("thumbnail") && app.thumbnail !== null) {
|
||||||
res.body = app.thumbnail;
|
res.body = app.thumbnail;
|
||||||
} else {
|
} else {
|
||||||
res.body = defaultThumb;
|
res.body = defaultThumb;
|
||||||
}
|
}
|
||||||
|
|
||||||
// evil mimetype detection attempt...
|
// evil mimetype detection attempt...
|
||||||
var start = require("internal").base64Decode(res.body.substr(0, 8));
|
var start = require("internal").base64Decode(res.body.substr(0, 8));
|
||||||
if (start.indexOf("PNG") !== -1) {
|
if (start.indexOf("PNG") !== -1) {
|
||||||
|
|
Loading…
Reference in New Issue