You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ra...@apache.org on 2021/10/15 16:40:08 UTC

[cordova-serve] branch master updated: fix(main.js): resolve deprecation warning on Node.js 12 (#45)

This is an automated email from the ASF dual-hosted git repository.

raphinesse pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-serve.git


The following commit(s) were added to refs/heads/master by this push:
     new ecee077  fix(main.js): resolve deprecation warning on Node.js 12 (#45)
ecee077 is described below

commit ecee0773005b329c30314cc5c5caaa27d565a0f2
Author: Zoltan Galantai Fekete <92...@users.noreply.github.com>
AuthorDate: Fri Oct 15 18:38:45 2021 +0200

    fix(main.js): resolve deprecation warning on Node.js 12 (#45)
    
    Fix Node version 12 deprecated OutgoingMessage.prototype._headers
    
    Co-authored-by: Raphael von der GrĂ¼n <ra...@gmail.com>
---
 src/main.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main.js b/src/main.js
index 69d4059..e651f12 100644
--- a/src/main.js
+++ b/src/main.js
@@ -33,7 +33,7 @@ function CordovaServe () {
         res.on('finish', function () {
             const color = this.statusCode === '404' ? chalk.red : chalk.green;
             let msg = `${color(this.statusCode)} ${this.req.originalUrl}`;
-            const encoding = this._headers && this._headers['content-encoding'];
+            const encoding = this.getHeader('content-encoding');
             if (encoding) {
                 msg += chalk.gray(` (${encoding})`);
             }

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