Skip to content

Commit

Permalink
Don't assume res._header exist
Browse files Browse the repository at this point in the history
`res._header` is an internal implementation detail. Hence,
some implementations of the http server do not set this.
[node-spdy](https://github.com/indutny/node-spdy) is an example.
  • Loading branch information
SpaceK33z committed Sep 19, 2016
1 parent 959d567 commit 294fd4e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/webjs.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ exports.GenericApp = class GenericApp
log_request: (req, res, data) ->
td = (new Date()) - req.start_date
@log('info', req.method + ' ' + req.url + ' ' + td + 'ms ' +
(if res.finished then res._header.split('\r')[0].split(' ')[1] \
(if res.finished and res._header then res._header.split('\r')[0].split(' ')[1] \
else '(unfinished)'))
return data

Expand Down

0 comments on commit 294fd4e

Please sign in to comment.