diff --git a/lib/server.js b/lib/server.js index ef0a742f..27ef516d 100644 --- a/lib/server.js +++ b/lib/server.js @@ -354,7 +354,7 @@ CloudServer._stated = function(pError, pStat){ if(pError){ CloudServer.Statuses[DirPath] = 404; - CloudServer.sendResponse('OK', pError.toString(), DirPath); + CloudServer.sendResponse(null, pError.toString(), DirPath); return; } @@ -383,12 +383,11 @@ Util.log(pError); CloudServer.Statuses[DirPath] = 404; - CloudServer.sendResponse('OK', pError.toString(), - DirPath); + CloudServer.sendResponse(null, pError.toString(), DirPath); return; } - /* Если мы не в корне добавляем слеш к будующим ссылкам */ + /* Если мы не в корне добавляем слеш к будующим ссылкам */ if(DirPath !== '/') DirPath += '/'; @@ -584,9 +583,9 @@ /* sending page not found */ lSrv.Statuses[pName] = 404; - lSrv.sendResponse('file not found', pError.toString(), pName); + lSrv.sendResponse(null, pError.toString(), pName); }else - lSrv.sendResponse('OK', 'passwd.json'); + lSrv.sendResponse(null, 'passwd.json'); } }; diff --git a/lib/server/main.js b/lib/server/main.js index c0f3d1ef..f85a7511 100644 --- a/lib/server/main.js +++ b/lib/server/main.js @@ -133,8 +133,7 @@ lContentEncoding = '', lCacheControl = 0, - lDot = pName.lastIndexOf('.'), - lExt = pName.substr(lDot); + lExt = Util.getExtension(pName); if( Util.strCmp(lExt, '.appcache') ) lCacheControl = 1;