-
-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't assume res._header
exists
#213
Conversation
`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.
res._header
existres._header
exists
@@ -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] \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will log (unfinished)
if res._header
does not exist, even if res.finished
is true
. Can you fix that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix my comment about the logging and we can get this merged.
@brycekahle, it seems like the internal |
Thanks! |
res._header
is an internal implementation detail. Hence, some implementations of the http server do not set this. You can't blame them for this, because this is a hack.node-spdy is an example.