Skip to content
Myr

header() should get request header

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

authored by visionmedia · committed by visionmedia · parent b0530b4 · Browse files · 2 files+6 added−6 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+6 added−6 removed

  • tests:+3 added−4 removed
  • other:+3 added−2 removed

2 files+6 added−6 removed

modified:lib/express/helpers.js+3 added-2 removed
107 unmodified lines
108 return Express.router.params[key]109}110111/**112 * Get or set the header field _key_ with _val_.112 * Set response header _key_ and _val_ or get113 * request header value by _key_.114 *115 * @param {string} key116 * @param {string} val117 * @return {string}
1 unmodified line
119 */120121exports.header = function(key, val) {122 return value === undefined ?122 Express.server.response.headers[key.toLowerCase()] :123 Express.server.request.headers[key.toLowerCase()] :124 Express.server.response.headers[key.toLowerCase()] = val125}126127/**
123 unmodified lines
modified:spec/spec.core.helpers.js+3 added-4 removed