mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
added temporary redirection for old no-js urls
This commit is contained in:
parent
6bc7445025
commit
c72e6f0742
2 changed files with 17 additions and 0 deletions
|
|
@ -160,6 +160,9 @@ for reading.
|
|||
* Commented e.stopImmediatePropagation() of function layerClick
|
||||
in contextmenu file, for correct work of context menu.
|
||||
|
||||
* Added temporary redirection for old no-js urls.
|
||||
|
||||
|
||||
2012.12.12, Version 0.1.8
|
||||
|
||||
* Added ability to shutdown Cloud Commander
|
||||
|
|
|
|||
14
cloudcmd.js
14
cloudcmd.js
|
|
@ -192,6 +192,9 @@
|
|||
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);
|
||||
|
||||
var lQuery = main.getQuery(p.request),
|
||||
lName = Minify.allowed.html ?
|
||||
Minify.getName(INDEX) : INDEX;
|
||||
|
|
@ -206,6 +209,7 @@
|
|||
index : lName
|
||||
});
|
||||
}
|
||||
/* termporary redirect for old urls */
|
||||
else
|
||||
lRet = false;
|
||||
}
|
||||
|
|
@ -213,6 +217,16 @@
|
|||
return lRet;
|
||||
}
|
||||
|
||||
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