Skip to content
Myr

Added res.download() 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 a5be68b · Browse files · 2 files+82 added−2 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+82 added−2 removed

  • tests:+78 added−0 removed
  • other:+4 added−2 removed

2 files+82 added−2 removed

modified:lib/response.js+4 added-2 removed
249 unmodified lines
250 * and optional callback `fn(err)`. The callback is invoked251 * when the data transfer is complete, or when an error has252 * ocurred. Be sure to check `res.headerSent` if you plan to respond.253 *254 * This method uses `res.attachment()` and `res.sendfile()`.254 * This method uses `res.sendfile()`.255 *256 * @param {String} path257 * @param {String|Function} filename or fn258 * @param {Function} fn
6 unmodified lines
265 fn = filename;266 filename = null;267 }268269 return this.attachment(filename || path).sendfile(path, fn);269 filename = filename || path;270 this.set('Content-Disposition', 'attachment; filename="' + basename(filename) + '"');271 return this.sendfile(path, fn);272};273274/**275 * Set _Content-Type_ response header with `type` through `mime.lookup()`
373 unmodified lines
added:test/res.download.js+78 added