Skip to content
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

Merged
merged 2 commits into from
Sep 19, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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] \
Copy link
Contributor

@brycekahle brycekahle Sep 19, 2016

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?

else '(unfinished)'))
return data

Expand Down