Skip to content

Commit 17e0c21

Browse files
committed
Version check URL generated incorrectly; ensured no trailing '/' in proxy_path component
1 parent 0be1eb3 commit 17e0c21

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/murfey/client/update.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ def check(api_base: ParseResult, install: bool = True, force: bool = False):
1515
If the version number is outside the allowed range then this can trigger
1616
an update on the client, and in that case will terminate the process.
1717
"""
18-
proxy_path = api_base.path
18+
proxy_path = api_base.path.rstrip("/")
1919
version_check_url = api_base._replace(
20-
path=f"{proxy_path}/version", query=f"client_version={murfey.__version__}"
20+
path=f"{proxy_path}/version/", query=f"client_version={murfey.__version__}"
2121
)
2222
server_reply = requests.get(version_check_url.geturl())
2323
if server_reply.status_code != 200:
@@ -60,7 +60,7 @@ def install_murfey(api_base: ParseResult, version: str) -> bool:
6060
Return 'true' on success and 'false' on error."""
6161

6262
assert api_base.hostname is not None
63-
proxy_path = api_base.path
63+
proxy_path = api_base.path.rstrip("/")
6464
result = subprocess.run(
6565
[
6666
sys.executable,

src/murfey/client/websocket.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ def __init__(
2727
websocket.enableTrace(True)
2828

2929
url = urllib.parse.urlparse(server)._replace(scheme="ws")
30-
proxy_path = url.path # Path component indicates what the proxy path used was
30+
proxy_path = url.path.rstrip(
31+
"/"
32+
) # Path component indicates what the proxy path used was
3133

3234
self._address = url.geturl()
3335
self._alive = True

0 commit comments

Comments
 (0)