mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
chore(main) add " "
This commit is contained in:
parent
981ed59201
commit
6f9e2b11fa
1 changed files with 8 additions and 10 deletions
|
|
@ -222,7 +222,6 @@
|
|||
*/
|
||||
function sendFile(pParams){
|
||||
var lRet = checkParams(pParams);
|
||||
console.log('####')
|
||||
if (lRet) {
|
||||
var p = pParams,
|
||||
lGzip = isGZIP(p.request) && p.gzip;
|
||||
|
|
@ -239,7 +238,6 @@
|
|||
write: p.response,
|
||||
zip : lGzip && !p.gziped,
|
||||
callback: function(pError) {
|
||||
console.log('****')
|
||||
var lError = pError && pError.toString();
|
||||
if (pError) {
|
||||
p.response.writeHead(FILE_NOT_FOUND, 'OK');
|
||||
|
|
@ -277,10 +275,10 @@
|
|||
|
||||
/* если браузер поддерживает gzip-сжатие - сжимаем данные*/
|
||||
Util.ifExec(!lGzip,
|
||||
function(pParams){
|
||||
function(pParams) {
|
||||
var lRet = Util.checkObj(pParams, ['data']);
|
||||
|
||||
if(lRet){
|
||||
if(lRet) {
|
||||
p.status = pParams.status || p.status;
|
||||
p.data = pParams.data;
|
||||
}
|
||||
|
|
@ -291,7 +289,7 @@
|
|||
Util.log( p.name + ' sended');
|
||||
},
|
||||
|
||||
function(pCallBack){
|
||||
function(pCallBack) {
|
||||
zlib.gzip (p.data || pData, Util.call(gzipData, {
|
||||
callback : pCallBack
|
||||
}));
|
||||
|
|
@ -319,7 +317,7 @@
|
|||
/**
|
||||
* send error response
|
||||
*/
|
||||
function sendError(pParams, pError){
|
||||
function sendError(pParams, pError) {
|
||||
var lRet = checkParams(pParams);
|
||||
|
||||
if(lRet){
|
||||
|
|
@ -397,7 +395,7 @@
|
|||
else
|
||||
lFiles = [pFiles];
|
||||
|
||||
for(var i = 0, n = lFiles.length; i < n; i++){
|
||||
for(var i = 0, n = lFiles.length; i < n; i++) {
|
||||
var lName = lFiles.pop();
|
||||
lDone.push(lName);
|
||||
|
||||
|
|
@ -408,7 +406,7 @@
|
|||
function checkParams(pParams, pAdditional){
|
||||
var lRet = Util.checkObjTrue( pParams, ['name', REQUEST, RESPONSE] );
|
||||
|
||||
if(lRet && pAdditional)
|
||||
if (lRet && pAdditional)
|
||||
lRet = Util.checkObjTrue( pParams, pAdditional);
|
||||
|
||||
return lRet;
|
||||
|
|
@ -417,7 +415,7 @@
|
|||
function getQuery(pReq){
|
||||
var lQuery, lParsedUrl;
|
||||
|
||||
if(pReq){
|
||||
if (pReq) {
|
||||
lParsedUrl = url.parse(pReq.url);
|
||||
lQuery = lParsedUrl.query;
|
||||
}
|
||||
|
|
@ -427,7 +425,7 @@
|
|||
|
||||
function isGZIP(pReq){
|
||||
var lEnc, lGZIP;
|
||||
if(pReq){
|
||||
if (pReq) {
|
||||
lEnc = pReq.headers['accept-encoding'] || '';
|
||||
lGZIP = lEnc.match(/\bgzip\b/);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue