support redirection for capes

This commit is contained in:
jomo
2015-04-25 22:59:33 +02:00
parent 5c53694f9d
commit 4286b35775
2 changed files with 2 additions and 8 deletions

View File

@@ -5,6 +5,7 @@ var cache = require("../cache");
// GET cape request
module.exports = function(req, callback) {
var userId = (req.url.pathname.split("/")[2] || "").split(".")[0];
var def = req.url.query.default;
var rid = req.id;
if (!helpers.id_valid(userId)) {
@@ -31,6 +32,7 @@ module.exports = function(req, callback) {
status: status,
body: image,
type: image ? "image/png" : undefined,
redirect: image ? undefined : def,
hash: hash,
err: err
});