Skip to content

Fix URL handling by preserving trailing slash#102

Open
allrob23 wants to merge 1 commit intoNHSDigital:developfrom
allrob23:develop
Open

Fix URL handling by preserving trailing slash#102
allrob23 wants to merge 1 commit intoNHSDigital:developfrom
allrob23:develop

Conversation

@allrob23
Copy link
Copy Markdown

Hello, while reviewing the code as part of an ongoing research project, we came across an issue with how URLs are handled when mounting adapters. The current implementation (Line 372 in mesh_client/__init__.py)uses:

self._url = (url.url if hasattr(url, "url") else url).rstrip("/")

This strips the trailing / from the URL, However, in lines 404–407, self._url is passed directly into self._session.mount(...). According to the Requests documentation, full hostnames are recommended to be terminated with a slash. Without the slash, certain requests may not be matched by the intended adapter.

We came across this issue while using the project in a research study. Thank you for your time and consideration.

@allrob23 allrob23 requested review from a team and matt-mercer as code owners September 20, 2025 02:05
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.

1 participant