closes #607344 by simply appending '/' to base url if necessary instead of insulting the user stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 22 Dec 2009 20:05:52 +0100
branchstable
changeset 4193 c3e7d0f85637
parent 4185 ed99de8f93f2
child 4194 7d5d469f81e1
closes #607344 by simply appending '/' to base url if necessary instead of insulting the user
etwist/server.py
--- a/etwist/server.py	Tue Dec 22 18:25:53 2009 +0100
+++ b/etwist/server.py	Tue Dec 22 20:05:52 2009 +0100
@@ -100,9 +100,11 @@
         self.debugmode = debug
         self.config = config
         self.base_url = config['base-url'] or config.default_base_url()
-        assert self.base_url[-1] == '/'
+        if self.base_url[-1] != '/':
+            self.base_url += '/'
         self.https_url = config['https-url']
-        assert not self.https_url or self.https_url[-1] == '/'
+        if self.https_url and self.https_url[-1] != '/'
+            self.https_url += '/'
         # instantiate publisher here and not in init_publisher to get some
         # checks done before daemonization (eg versions consistency)
         self.appli = CubicWebPublisher(config, debug=self.debugmode)