add support for x-forwarded-host header

This commit is contained in:
jhnns 2013-10-10 18:33:08 +02:00
parent 0dad78e225
commit bdca5465a9
1 changed files with 2 additions and 1 deletions

View File

@ -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?