diff --git a/CHANGELOG.md b/CHANGELOG.md index 03470110..c6b44539 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -107,7 +107,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 +* [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) @@ -132,6 +136,8 @@ * [#604](https://github.com/foosel/OctoPrint/issues/604) - Properly initialize settings basedir on server startup * [IRC] Also allow downloading .g files via Tornado +([Commits](https://github.com/foosel/OctoPrint/compare/1.1.0...1.1.1)) + ## 1.1.0 (2014-09-03) ### New Features diff --git a/src/octoprint/settings.py b/src/octoprint/settings.py index f8c82fc8..ed16bd57 100644 --- a/src/octoprint/settings.py +++ b/src/octoprint/settings.py @@ -45,8 +45,10 @@ default_settings = { "reverseProxy": { "prefixHeader": "X-Script-Name", "schemeHeader": "X-Scheme", + "hostHeader": "X-Forwarded-Host", "prefixFallback": "", - "schemeFallback": "" + "schemeFallback": "", + "hostFallback": "" }, "uploads": { "maxSize": 1 * 1024 * 1024 * 1024, # 1GB diff --git a/src/octoprint/templates/index.jinja2 b/src/octoprint/templates/index.jinja2 index 955d4ea6..928112c0 100644 --- a/src/octoprint/templates/index.jinja2 +++ b/src/octoprint/templates/index.jinja2 @@ -59,7 +59,7 @@ var CONFIG_GCODE_SIZE_THRESHOLD = {{ gcodeThreshold }}; var CONFIG_GCODE_MOBILE_SIZE_THRESHOLD = {{ gcodeMobileThreshold }}; - var SOCKJS_URI = window.location.protocol.slice(0, -1) + "://" + (window.document ? window.document.domain : window.location.hostname) + ":" + window.location.port + BASEURL + "sockjs"; + var SOCKJS_URI = "{{ url_for('index') }}" + "sockjs"; var SOCKJS_DEBUG = {% if debug -%} true; {% else %} false; {%- endif %} var UI_API_KEY = "{{ uiApiKey }}";