From bdca5465a9fa688b725e407475ef6e0c8c99a2e1 Mon Sep 17 00:00:00 2001 From: jhnns Date: Thu, 10 Oct 2013 18:33:08 +0200 Subject: [PATCH] add support for x-forwarded-host header --- proxy.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proxy.coffee b/proxy.coffee index dcea1d0..ed78866 100644 --- a/proxy.coffee +++ b/proxy.coffee @@ -20,7 +20,8 @@ proxy = (req, res, next) -> # Config? if req.url is '/config.json' # Refer to us like so. - scrubbed.host = req.headers.host + # Prefer custom header x-forwarded-host if defined. + scrubbed.host = req.headers['x-forwarded-host'] or req.headers.host return write 200, JSON.stringify scrubbed, null, 4 # API request?