Skip to content
Myr

Added contentType() helper

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

authored by visionmedia · committed by visionmedia · parent 64a4741 · Browse files · 2 files+23 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+23 added−0 removed

  • tests:+10 added−0 removed
  • other:+13 added−0 removed

2 files+23 added−0 removed

modified:lib/express/helpers.js+13 added
245 unmodified lines
246 for (var i = 0, len = pairs.length; i < len; ++i)247 pair = pairs[i].split('='),248 params[pair[0]] = pair[1]249 return parseNestedParams(params)250}251252/**253 * Set Content-Type header to the mime type254 * for the given _path_, which calls mime().255 *256 * @param {string} path257 * @see mime()258 * @api public259 */260261exports.contentType = function(path) {262 header('content-type', mime(path))263}
modified:spec/spec.helpers.js+10 added