Merge pull request #28 from jhnns/fix-proxy-behind-proxy-bug
Add support for x-forwarded-host header
This commit is contained in:
commit
be1bd07abe
|
@ -20,7 +20,8 @@ proxy = (req, res, next) ->
|
||||||
# Config?
|
# Config?
|
||||||
if req.url is '/config.json'
|
if req.url is '/config.json'
|
||||||
# Refer to us like so.
|
# 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
|
return write 200, JSON.stringify scrubbed, null, 4
|
||||||
|
|
||||||
# API request?
|
# API request?
|
||||||
|
|
Loading…
Reference in New Issue