Univention Bugzilla – Bug 55785
Portal does not properly detect protocol type
Last modified: 2023-07-05 14:48:53 CEST
Components like the central navigation do not create the correct links (starting with https) as the portal does not analyse correctly the protocol in use to set these links correctly. This probably also affects the link selection when adding http / https mixed links to a portal entry. Florian already provided a fix for the issue that was successfully tested regarding the above mentioned problem with the central navigation. index e0f90e14c6..0023f1c434 100755 --- management/univention-portal/univention-portal-server +++ management/univention-portal/univention-portal-server @@ -52,6 +52,11 @@ class PortalResource(tornado.web.RequestHandler): def initialize(self, portals): self.portals = portals + def prepare(self, *args, **kwargs): + super().prepare(*args, **kwargs) + self.request.headers.get('X-UMC-HTTPS') == 'on': + self.request.protocol = 'https' + def write_error(self, status_code, **kwargs): if "exc_info" in kwargs: get_logger("server").exception("Error during service")
How do we test whether this works?
96bfbcf455 | fix(portal): HTTPS detection when acessing navigation.json endpoint behind UCS apache reverse proxy QA: the following command should give https based URLs, not http-based: # curl -sk https://Administrator:univention@localhost/univention/portal/navigation.json | python -m json.tool | grep -e icon_url -e link "icon_url": "https://localhost/univention/portal/icons/entries/login-ucs.svg", "link": "https://localhost/univention/login/?location=/univention/portal/", "icon_url": "https://localhost/univention/portal/icons/entries/umc-domain.svg", "link": "https://localhost/univention/umc/",
QA: - correct HTTPS links are created: OK - yaml: OK - no related traceback/errors in logfiles: OK
<https://errata.software-univention.de/#/?erratum=5.0x726>