Skip to content
Myr

utilize res.headerSent from connect

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 4b0b55c · Browse files · 1 file+2 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−6 removed

  • other:+2 added−6 removed

1 file+2 added−6 removed

modified:lib/response.js+2 added-6 removed
176 unmodified lines
177 }178179 // callback180 options.callback = function(err){181 // TODO: remove when node adds this182 self.sentHeader = !! self._header;183184 // error181 if (err) {182 // ditch content-disposition to prevent funky responses187 if (!self.sentHeader) self.removeHeader('Content-Disposition');183 if (!self.headerSent) self.removeHeader('Content-Disposition');184185 // not found186 if ('ENOENT' == err.code) return req.next();187188 // lost in limbo if there's no callback193 if (self.sentHeader) return fn && fn(err);189 if (self.headerSent) return fn && fn(err);190191 // callback available192 if (fn) return fn(err);193
360 unmodified lines