mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-08-03 13:13:10 +00:00
added redirect function
This commit is contained in:
parent
e8edb83d14
commit
b21c2b15f4
4 changed files with 81 additions and 62 deletions
16
cloudcmd.js
16
cloudcmd.js
|
|
@ -233,8 +233,10 @@
|
|||
lRet = main.sendFile( pParams );
|
||||
}
|
||||
else if( Util.isContainStr(p.name, FS) || Util.strCmp( p.name, '/') ){
|
||||
if( Util.isContainStr(p.name, 'no-js/') )
|
||||
return noJSTMPRedirection(pParams);
|
||||
if( Util.isContainStr(p.name, 'no-js/') ){
|
||||
var lURL = Util.removeStr(pParams.name, 'no-js/');
|
||||
return main.redirect(pParams, lURL);
|
||||
}
|
||||
|
||||
lRet = sendCommanderContent(p);
|
||||
}
|
||||
|
|
@ -303,16 +305,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
function noJSTMPRedirection(pParams){
|
||||
var MOVED_PERMANENTLY = 301,
|
||||
lPath = Util.removeStr(pParams.name, 'no-js/');
|
||||
|
||||
pParams.response.writeHead(MOVED_PERMANENTLY, {'Location': lPath});
|
||||
pParams.response.end();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/* function sets stdout to file log.txt */
|
||||
function writeLogsToFile(){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue