diff src/server/server.py @ 881:6bdee34fa2f4

server: added base_url_ext option to handle different external URLs (e.g.: if there is a proxy)
author Goffi <goffi@goffi.org>
date Wed, 09 Mar 2016 18:38:52 +0100
parents d9b98b8a1847
children 763da94ba28b
line wrap: on
line diff
--- a/src/server/server.py	Wed Mar 09 17:56:19 2016 +0100
+++ b/src/server/server.py	Wed Mar 09 18:38:52 2016 +0100
@@ -1465,6 +1465,12 @@
         self.options = options
         self.initialised = defer.Deferred()
 
+        if self.options['base_url_ext']:
+            self.base_url_ext = self.options.pop('base_url_ext')
+            if self.base_url_ext[-1] != '/':
+                self.base_url_ext += '/'
+        else:
+            self.base_url_ext = None
         if not self.options['port_https_ext']:
             self.options['port_https_ext'] = self.options['port_https']
         if self.options['data_dir'] == DATA_DIR_DEFAULT: