Skip to content
Myr

fixed downloads example

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 722a92f · Browse files · 2 files+15 added−22 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+15 added−22 removed

  • other:+15 added−22 removed

2 files+15 added−22 removed

modified:examples/downloads/app.js+12 added-21 removed
modified:lib/response.js+3 added-1 removed
208 unmodified lines
209 // cast ENOENT210 if ('ENOENT' == err.code) err = 404;211212 // coerce numeric error to an Error213 // TODO: remove214 // TODO: remove docs for headerSent?215 if ('number' == typeof err) err = utils.error(err);216217 // ditch content-disposition to prevent funky responses218 if (!self.headerSent) self.removeHeader('Content-Disposition');
20 unmodified lines
239 *240 * Optionally providing an alternate attachment `filename`,241 * and optional callback `fn(err)`. The callback is invoked242 * when the data transfer is complete, or when an error has241 * ocurred. Be sure to check `res.sendHeader` if you plan to respond.243 * ocurred. Be sure to check `res.headerSent` if you plan to respond.244 *245 * @param {String} path246 * @param {String|Function} filename or fn247 * @param {Function} fn
351 unmodified lines