Skip to content
Myr

Added `req.host`

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 d5fde6a · Browse files · 2 files+29 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+29 added−0 removed

  • tests:+18 added−0 removed
  • other:+11 added−0 removed

2 files+29 added−0 removed

modified:lib/request.js+11 added
367 unmodified lines
368 return parse(this).pathname;369});370371/**372 * Parse the "Host" header field hostname.373 *374 * @return {String}375 * @api public376 */377378req.__defineGetter__('host', function(){379 return this.get('Host').split(':')[0];380});381382/**383 * Check if the request is fresh, aka384 * Last-Modified and/or the ETag385 * still match.386 *
32 unmodified lines
added:test/req.host.js+18 added