8000 Don't assume `res._header` exist · sockjs/sockjs-node@294fd4e · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit 294fd4e

Browse files
committed
Don't assume res._header exist
`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.
1 parent 959d567 commit 294fd4e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/webjs.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ exports.GenericApp = class GenericApp
120120
log_request: (req, res, data) ->
121121
td = (new Date()) - req.start_date
122122
@log('info', req.method + ' ' + req.url + ' ' + td + 'ms ' +
123-
(if res.finished then res._header.split('\r')[0].split(' ')[1] \
123+
(if res.finished and res._header then res._header.split('\r')[0].split(' ')[1] \
124124
else '(unfinished)'))
125125
return data
126126

0 commit comments

Comments
 (0)
0