Skip to content

wms_service_cache should use complete url - #3176

Open
JanEisermann wants to merge 7 commits into
Open-MSS:developfrom
JanEisermann:wms_service_cache_2841
Open

wms_service_cache should use complete url#3176
JanEisermann wants to merge 7 commits into
Open-MSS:developfrom
JanEisermann:wms_service_cache_2841

Conversation

@JanEisermann

Copy link
Copy Markdown
Collaborator

Purpose of PR?:

Fixes #2841

Does this PR introduce a breaking change?
use of a slugify version of the full url instead of the base_url in the wms_service_cache

If the changes in this PR are manually verified, list down the scenarios covered::
tests succeed, not manually verified

Additional information for reviewer? :
Mention if this PR is part of any design or a continuation of previous PRs

Does this PR results in some Documentation changes?
If yes, include the list of Documentation changes

Checklist:

  • Bug fix. Fixes #
  • New feature (Non-API breaking changes that adds functionality)
  • PR Title follows the convention of <type>: <subject>
  • Commit has unit tests

@ReimarBauer ReimarBauer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comment

Comment thread mslib/utils/service_manager.py Outdated
Comment thread mslib/utils/service_manager.py Outdated
Comment thread tests/_test_utils/test_service_manager.py

@ReimarBauer ReimarBauer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks strange, you have added changes which are not yours

@JanEisermann

Copy link
Copy Markdown
Collaborator Author

It happened while I rebased. I don't know why it looks strange like that. I try a new rebase.

@JanEisermann
JanEisermann force-pushed the wms_service_cache_2841 branch from 7df3722 to 7d4f6b7 Compare September 9, 2026 14:07
JanEisermann and others added 5 commits September 9, 2026 16:11
Slugifying the normalized url collapses all url separators into "-", so
distinct services map onto the same key, e.g. "http://a.com:1/wms" and
"http://a.com/1/wms" both became "http-a-com-1-wms". The same happened
for query parameters versus path elements. The normalized url is a fine
dict key on its own, so keep it as is.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Cover the urls which collided when the key was slugified (port versus
path element, host boundary, query parameters versus path) as well as
the urls which have to share a key (GetCapabilities parameters, order of
the remaining parameters, case of scheme and host) and the cache lookups
of WMSServiceManager built on them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@JanEisermann
JanEisermann force-pushed the wms_service_cache_2841 branch from 7d4f6b7 to ce186f4 Compare September 9, 2026 14:14


def strip_request_params(url):
"""Remove the OGC request parameters (service, request) from an url.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strip_request_params('http://example.com/wms?dataset=&service=WMS')
# -> 'http://example.com/wms'   (dataset= vanished, not just service=WMS)
strip_request_params('http://example.com/wms?debug&service=WMS')
# -> 'http://example.com/wms'   (bare `debug` flag vanished)

This directly contradicts the docstring's guarantee ("All other query parameters are kept in their original order")

Maybe fix the docstring to what it is doing. Recheck what is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wms_service_cache should use complete url

2 participants