Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Commit

Permalink
fix: Request logging broken in Electron (#808)
Browse files Browse the repository at this point in the history
check whether res.req is set instead of relying on detect-node
  • Loading branch information
requilence authored and alanshaw committed Jul 10, 2018
1 parent dcbbe74 commit 52298ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/send-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function onRes (buffer, cb) {
const isJson = res.headers['content-type'] &&
res.headers['content-type'].indexOf('application/json') === 0

if (isNode) {
if (res.req) {
log(res.req.method, `${res.req.getHeaders().host}${res.req.path}`, res.statusCode, res.statusMessage)
} else {
log(res.url, res.statusCode, res.statusMessage)
Expand Down

0 comments on commit 52298ae

Please sign in to comment.