Fix malformed URL when address contains trailing slash - #536
Merged
rroller merged 5 commits intoJan 7, 2026
Conversation
When the configured address ends with a trailing slash (e.g., 192.168.3.65/), the base URL is incorrectly constructed as http://192.168.3.65/:80 instead of http://192.168.3.65:80, causing 404 errors on API calls. This fix strips trailing slashes from the address when storing it, which also fixes the same potential issue in RTSP URL construction. Fixes rroller#474
Contributor
Author
|
Note: The CI test failure is a pre-existing issue unrelated to this PR. The |
pytest-homeassistant-custom-component==0.13.286 requires Python 3.13+
pytest-homeassistant-custom-component 0.13.286 has dependency issues with Python 3.13 (aiodns/pycares incompatibility). Using 0.13.205 which is the latest version compatible with Python 3.12.
pycares 5.0 has breaking API changes that aiodns hasn't adapted to yet. Pin to pycares 4.x to resolve the AttributeError with ares_query_a_result. See: home-assistant/core#158695
- Add conftest.py to load pytest-homeassistant-custom-component fixtures - Add pytest.ini with asyncio_mode=auto for async test support
Contributor
Author
|
The CI is fixed now. |
Owner
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Problem
When the address is entered with a trailing slash (e.g.,
192.168.3.65/), the base URL is incorrectly constructed as:instead of:
This causes 404 errors on API calls.
Solution
Strip trailing slashes from the address when storing it in
self._address. This also fixes the same potential issue in RTSP URL construction.Test plan
192.168.3.65)192.168.3.65/)Fixes #474