Don't user server.host but server.forwardedHost as fallback for generated external URLs

Closes #698
This commit is contained in:
Gina Häußge 2014-12-30 10:20:50 +01:00
parent e3383fe4c1
commit 87ddcac2fc
3 changed files with 8 additions and 5 deletions

View file

@ -11,9 +11,11 @@
* [#634](https://github.com/foosel/OctoPrint/pull/634) - Fixed missing `branch` fields in version dicts generated
by versioneer
* [IRC] Don't hiccup on slic3r filament_diameter comments generated for multi extruder setups
* [ML] Fixed relative URL to sockjs endpoint, wasn't yet using the proper base url
* [unreported] Generated URLs now take X-Forwarded-Host header sent by proxies into account for included host and port
* [IRC] - Don't hiccup on slic3r filament_diameter comments generated for multi extruder setups
* [ML] - Fixed relative URL to sockjs endpoint, wasn't yet using the proper base url
* [unreported] & [#698](https://github.com/foosel/OctoPrint/issues/698) - Generated URLs now take X-Forwarded-Host header
sent by proxies into account for included host and port, also fixed [#698](https://github.com/foosel/OctoPrint/issues/698)
introduced by this
* Small fixes for timelapse creation:
- [#344](https://github.com/foosel/OctoPrint/issues/344) - Made timelapses capable of coping with missing captures in between by decrementing the image counter again if there
was an error fetching the latest image from the snapshot URL (backport of [1a7a468](https://github.com/foosel/OctoPrint/commit/1a7a468eb65fdf2a13b4c7a7723280e822c9c34b)

View file

@ -376,7 +376,7 @@ class ReverseProxied(object):
host = environ.get('HTTP_X_FORWARDED_HOST', '')
if not host:
host = settings().get(["server", "host"])
host = settings().get(["server", "forwardedHost"])
if host:
environ['HTTP_HOST'] = host

View file

@ -43,7 +43,8 @@ default_settings = {
"firstRun": True,
"secretKey": None,
"baseUrl": "",
"scheme": ""
"scheme": "",
"forwardedHost": ""
},
"webcam": {
"stream": None,