added temporary redirection for old no-js urls

This commit is contained in:
coderaiser 2013-02-21 03:55:03 -05:00
parent 6bc7445025
commit c72e6f0742
2 changed files with 17 additions and 0 deletions

View file

@ -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

View file

@ -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(){