raphinesse commented on a change in pull request #45:
URL: https://github.com/apache/cordova-serve/pull/45#discussion_r729918273
##########
File path: src/main.js
##########
@@ -33,7 +33,8 @@ 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 headers = this.getHeaders();
+ const encoding = headers && headers['content-encoding'];
Review comment:
Why not use
[outgoingMessage.getHeader](https://nodejs.org/api/http.html#http_outgoingmessage_getheader_name)?
That should work, AFAICT...
```suggestion
const encoding = this.getHeader('content-encoding');
```
##########
File path: src/main.js
##########
@@ -33,7 +33,8 @@ 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 headers = this.getHeaders();
+ const encoding = headers && headers['content-encoding'];
Review comment:
Just verified that this works
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]