mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-25 08:54:10 +00:00
fixed bug with reading folder with no access
This commit is contained in:
parent
c3b231a8c5
commit
fd3838f5ec
8 changed files with 93 additions and 64 deletions
|
|
@ -41,7 +41,7 @@
|
|||
c = pParams.params,
|
||||
lFiles = p.data,
|
||||
lDirPath = getDirPath(c.path);
|
||||
|
||||
|
||||
if(!p.error && lFiles){
|
||||
lFiles.data = lFiles.sort();
|
||||
|
||||
|
|
@ -76,7 +76,7 @@
|
|||
fillJSON(lFilesData);
|
||||
}
|
||||
else
|
||||
Util.exec(p.callback, p.error.toString());
|
||||
Util.exec(c.callback, p.error.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -215,7 +215,6 @@
|
|||
lRes = pParams.response;
|
||||
lGziped = pParams.gziped;
|
||||
}
|
||||
|
||||
if(lName && lRes && lReq){
|
||||
var lGzip = isGZIP(lReq),
|
||||
|
||||
|
|
|
|||
|
|
@ -69,22 +69,23 @@
|
|||
lRet = Util.isContainStr(p.name, CloudFunc.FS);
|
||||
if( lRet)
|
||||
onFS(pParams);
|
||||
|
||||
if(p.name[0] === '/')
|
||||
p.command = Util.removeStr(p.name, '/');
|
||||
|
||||
switch(p.request.method){
|
||||
case 'GET':
|
||||
lRet = onGET(pParams);
|
||||
break;
|
||||
|
||||
case 'PUT':
|
||||
getBody(pParams.request, function(pBody){
|
||||
pParams.body = pBody;
|
||||
onPUT(pParams);
|
||||
});
|
||||
break;
|
||||
}
|
||||
else{
|
||||
if(p.name[0] === '/')
|
||||
p.command = Util.removeStr(p.name, '/');
|
||||
|
||||
switch(p.request.method){
|
||||
case 'GET':
|
||||
lRet = onGET(pParams);
|
||||
break;
|
||||
|
||||
case 'PUT':
|
||||
getBody(pParams.request, function(pBody){
|
||||
pParams.body = pBody;
|
||||
onPUT(pParams);
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return lRet;
|
||||
}
|
||||
|
|
@ -95,7 +96,7 @@
|
|||
var p = pParams,
|
||||
lQuery = main.getQuery(p.request);
|
||||
|
||||
p.name = Util.removeStr(p.name, [CloudFunc.FS, '?dir']) || '/';
|
||||
p.name = Util.removeStrOneTime(p.name, [CloudFunc.FS, '?dir']) || '/';
|
||||
switch(p.request.method){
|
||||
case 'GET':
|
||||
fs.stat(p.name, function(pError, pStat){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue