From 26fb6a138a6c43f4068045a3807cea92356ff2ab Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Tue, 7 Jan 2014 17:22:46 -0800 Subject: [PATCH] add ctx.host= delegate --- docs/api/context.md | 1 + lib/context.js | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/docs/api/context.md b/docs/api/context.md index 56e1e52..0fb0032 100644 --- a/docs/api/context.md +++ b/docs/api/context.md @@ -119,6 +119,7 @@ throw err; - `ctx.querystring=` - `ctx.length` - `ctx.host` + - `ctx.host=` - `ctx.fresh` - `ctx.stale` - `ctx.socket` diff --git a/lib/context.js b/lib/context.js index 7a4fd6a..87e50eb 100644 --- a/lib/context.js +++ b/lib/context.js @@ -275,6 +275,14 @@ module.exports = { return this.request.host; }, + /** + * Delegate to Request#host=. + */ + + set host(val) { + this.request.host = val; + }, + /** * Delegate to Request#fresh. */