Skip to content
Myr

Added res.type() alias of res.contentType()

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 ad9bbda · Browse files · 1 file+3 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

1 file+3 added−1 removed

  • other:+3 added−1 removed

1 file+3 added−1 removed

modified:lib/response.js+3 added-1 removed
242 unmodified lines
243 * res.contentType('.html');244 * res.contentType('html');245 * res.contentType('json');246 * res.contentType('png');247 * res.type('png');248 *249 * @param {String} type250 * @return {ServerResponse} for chaining251 * @api public252 */253253res.contentType = function(type){254res.contentType =255res.type = function(type){256 return this.header('Content-Type', mime.lookup(type));257};258259/**
197 unmodified lines