Skip to content

Commit

Permalink
Merge pull request #4429 from geoadmin/feat_allow_localhost_wmsUrl
Browse files Browse the repository at this point in the history
for the local development we need to set localhost:<port> as wmsUrl
  • Loading branch information
ltclm authored Aug 8, 2024
2 parents 339d196 + 9aa1457 commit 4b69749
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion chsdi/models/bod.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 4b69749

Please sign in to comment.