mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-25 00:50:59 +00:00
feature(main) add getPathName
This commit is contained in:
parent
42ef8ae29f
commit
6281248304
2 changed files with 18 additions and 8 deletions
|
|
@ -167,16 +167,16 @@
|
|||
lConfig = main.config,
|
||||
lParsedUrl = URL.parse(pReq.url),
|
||||
lQuery = lParsedUrl.search || '',
|
||||
lPath = lParsedUrl.pathname;
|
||||
path = main.getPathName(pReq);
|
||||
|
||||
/* added supporting of Russian language in directory names */
|
||||
lPath = Querystring.unescape(lPath);
|
||||
path = Querystring.unescape(path);
|
||||
|
||||
if (!expressApp)
|
||||
Util.log(pReq.method + ' ' + lPath + lQuery);
|
||||
Util.log(pReq.method + ' ' + path + lQuery);
|
||||
|
||||
data = {
|
||||
name : lPath,
|
||||
name : path,
|
||||
request : pReq,
|
||||
response : pRes
|
||||
};
|
||||
|
|
@ -237,9 +237,7 @@
|
|||
dir = DIR,
|
||||
gzip = zlib.createGzip(),
|
||||
isGzip = main.isGZIP(request),
|
||||
|
||||
parsedUrl = URL.parse(request.url),
|
||||
path = parsedUrl.pathname,
|
||||
path = main.getPathName(request),
|
||||
|
||||
isJoin = CloudFunc.isJoinURL(path),
|
||||
readPipe = function() {
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@
|
|||
|
||||
exports.generateHeaders = generateHeaders,
|
||||
exports.getQuery = getQuery,
|
||||
exports.getPathName = getPathName,
|
||||
exports.isGZIP = isGZIP,
|
||||
exports.mainSetHeader = mainSetHeader,
|
||||
|
||||
|
|
@ -416,10 +417,21 @@
|
|||
parsed = url.parse(req.url);
|
||||
query = parsed.query;
|
||||
}
|
||||
|
||||
|
||||
return query;
|
||||
}
|
||||
|
||||
function getPathName(req) {
|
||||
var pathname, parsed;
|
||||
|
||||
if (req) {
|
||||
parsed = url.parse(req.url);
|
||||
pathname = parsed.pathname;
|
||||
}
|
||||
|
||||
return pathname;
|
||||
}
|
||||
|
||||
function isGZIP(pReq) {
|
||||
var lEnc, lGZIP;
|
||||
if (pReq) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue