Skip to content
Myr

Added failing res.sendfile() test for 403 + callback

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 c9f184c · Browse files · 2 files+26 added−1 removed
This commit

State

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

Diff stats

2 files+26 added−1 removed

  • tests:+22 added−0 removed
  • other:+4 added−1 removed

2 files+26 added−1 removed

modified:lib/response.js+4 added-1 removed
181 unmodified lines
182 // ditch content-disposition to prevent funky responses183 if (!self.headerSent) self.removeHeader('Content-Disposition');184185 // forbidden186 if ('Forbidden' == err.message) return req.next(403);186 if ('Forbidden' == err.message) {187 if (fn) return fn(err);188 return req.next(403);189 }190191 // not found192 if ('ENOENT' == err.code) {193 if (fn) return fn(err);
369 unmodified lines
modified:test/res.sendfile.js+22 added