# HG changeset patch # User Pierre-Yves David # Date 1365430769 -7200 # Node ID a46197b1696f8d0d1f374b22f8b038b2c5d90ce2 # Parent 12f29b0ed0bba02f697f5c979687d7559e050785 [webconfig] fallback to default configs if https ones are not defined When cubicweb serves a request with an https scheme, it tries to access ``https_uiprops`` and ``https_datadir_urls``. However if those are not defined we should fallback to unsecure url instead of crashing with a traceback. There are very valid usecases for undefined https url. For example if your ``base_url``, ``datadir_url`` and uiprops content are already https urls. Closes #2786643 diff -r 12f29b0ed0bb -r a46197b1696f web/request.py --- a/web/request.py Mon Apr 08 16:13:03 2013 +0200 +++ b/web/request.py Mon Apr 08 16:19:29 2013 +0200 @@ -100,11 +100,13 @@ self.uiprops = None #: url for serving datadir (vary with https) (see :ref:`resources`) self.datadir_url = None - if https: + if https and vreg.config.https_uiprops is not None: self.uiprops = vreg.config.https_uiprops + else: + self.uiprops = vreg.config.uiprops + if https and vreg.config.https_datadir_url is not None: self.datadir_url = vreg.config.https_datadir_url else: - self.uiprops = vreg.config.uiprops self.datadir_url = vreg.config.datadir_url #: raw html headers that can be added from any view self.html_headers = HTMLHead(self)