cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject [1/2] cordova-browser git commit: CB-9654 'cordova run browser' -> duplicate 'CTRL + C' messages.
Date Tue, 15 Sep 2015 07:10:27 GMT
Repository: cordova-browser
Updated Branches:
  refs/heads/master 8059c5d47 -> 62b72ca7a


http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/62b72ca7/node_modules/cordova-serve/src/stream.js
----------------------------------------------------------------------
diff --git a/node_modules/cordova-serve/src/stream.js b/node_modules/cordova-serve/src/stream.js
index b16de62..dd6ebaf 100644
--- a/node_modules/cordova-serve/src/stream.js
+++ b/node_modules/cordova-serve/src/stream.js
@@ -17,9 +17,11 @@
  under the License.
  */
 
-var fs = require('fs'),
+var chalk = require('chalk'),
+    fs = require('fs'),
     mime = require('mime'),
-    zlib = require('zlib');
+    zlib = require('zlib'),
+    server = require('./server');
 
 // d8 is a date parsing and formatting micro-framework
 // Used only for RFC 2822 formatting
@@ -51,21 +53,22 @@ module.exports = function (filePath, request, response, readStream, noCache)
{
     }
 
     var acceptEncoding = request.headers['accept-encoding'] || '';
+    var encoding = '';
     if (acceptEncoding.match(/\bgzip\b/)) {
-        console.log('gzip');
+        encoding ='(gzip)';
         respHeaders['content-encoding'] = 'gzip';
         readStream = readStream.pipe(zlib.createGzip());
     } else if (acceptEncoding.match(/\bdeflate\b/)) {
-        console.log('deflate');
+        encoding ='(deflate)';
         respHeaders['content-encoding'] = 'deflate';
         readStream = readStream.pipe(zlib.createDeflate());
     }
 
     respHeaders['Last-Modified'] = new Date(fs.statSync(filePath).mtime).format('r');
     if (noCache) {
-        respHeaders['Cache-Control'] = 'no-cache';
+        respHeaders['Cache-Control'] = 'no-store';
     }
-    console.log('200 ' + request.url + ' (' + filePath + ')');
+    server.log(chalk.green('200 ') + request.url + ' ' + encoding);
     response.writeHead(200, respHeaders);
     readStream.pipe(response);
     return readStream;

http://git-wip-us.apache.org/repos/asf/cordova-browser/blob/62b72ca7/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 29f7045..475778e 100644
--- a/package.json
+++ b/package.json
@@ -14,7 +14,7 @@
     ],
     "dependencies": {
         "adm-zip": "0.4.4",
-        "cordova-serve": "^0.1.2",
+        "cordova-serve": "^0.1.3",
         "nopt": "~3",
         "shelljs": "^0.1.4"
     },
@@ -36,4 +36,4 @@
         }
     ],
     "license": "Apache-2.0"
-}
\ No newline at end of file
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message