split pathname into array, URL decode, fix #65

This commit is contained in:
jomo
2015-01-04 03:37:51 +01:00
parent bbc71b0d6c
commit cbbfb73bea
4 changed files with 16 additions and 10 deletions

View File

@@ -15,7 +15,7 @@ var human_status = {
// GET avatar request
module.exports = function(req, res) {
var start = new Date();
var uuid = (req.url.pathname.split("/")[2] || "").split(".")[0];
var uuid = (req.url.path_list[2] || "").split(".")[0];
var size = parseInt(req.url.query.size) || config.default_size;
var def = req.url.query.default;
var helm = req.url.query.hasOwnProperty("helm");

View File

@@ -20,7 +20,7 @@ var human_status = {
// GET render request
module.exports = function(req, res) {
var start = new Date();
var raw_type = (req.url.pathname.split("/")[2] || "");
var raw_type = (req.url.path_list[2] || "");
// validate type
if (raw_type != "body" && raw_type != "head") {
@@ -33,7 +33,7 @@ module.exports = function(req, res) {
}
var body = raw_type == "body";
var uuid = (req.url.pathname.split("/")[3] || "").split(".")[0];
var uuid = (req.url.path_list[3] || "").split(".")[0];
var def = req.url.query.default;
var scale = parseInt(req.url.query.scale) || config.default_scale;
var helm = req.url.query.hasOwnProperty("helm");

View File

@@ -8,7 +8,7 @@ var lwip = require("lwip");
// GET skin request
module.exports = function(req, res) {
var start = new Date();
var uuid = (req.url.pathname.split("/")[2] || "").split(".")[0];
var uuid = (req.url.path_list[2] || "").split(".")[0];
var def = req.url.query.default;
var etag = null;