From 9aa145761e0ef4b475d19a2516c294a914565f89 Mon Sep 17 00:00:00 2001 From: Marcel Clausen Date: Wed, 7 Aug 2024 20:38:36 +0200 Subject: [PATCH] for the local development we need to set localhost: as wmsUrl in that case the protocol should not be set to https --- chsdi/models/bod.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chsdi/models/bod.py b/chsdi/models/bod.py index 7b5bf9274a..7b00966b7f 100644 --- a/chsdi/models/bod.py +++ b/chsdi/models/bod.py @@ -136,7 +136,9 @@ def layerConfig(self, params): del config['timeBehaviour'] if config['type'] == 'wms': - config['wmsUrl'] = 'https://%s' % wmsHost + # do not use https if wmsUrl starts with localhost + protocol = "http" if wmsHost.lower().startswith('localhost') else "https" + config['wmsUrl'] = f'{protocol}://{wmsHost}' elif config['type'] == 'geojson': api_url = params.request.registry.settings['api_url'] config['styleUrl'] = make_agnostic(