Skip to content
Myr

Added forbidden tests

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 7e6d8f3 · Browse files · 2 files+48 added−0 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+48 added−0 removed

  • tests:+45 added−0 removed
  • other:+3 added−0 removed

2 files+48 added−0 removed

modified:lib/response.js+3 added
180 unmodified lines
181 if (err) {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);187188 // not found189 if ('ENOENT' == err.code) return req.next(404);190191 // lost in limbo if there's no callback
365 unmodified lines
modified:test/res.sendfile.js+45 added