From bcf1f5511c2107616076784d2316708bea5328f2 Mon Sep 17 00:00:00 2001 From: disqualifier Date: Sun, 28 Jun 2026 17:18:28 -0400 Subject: [PATCH] fix: _proxy_string emits no stray colons for a portless proxy a portless proxy url produced host::user:pass / host: (extra colons), breaking the identity match against the provider pool. the port colon is now omitted when there is no port, mirroring aioproxies' canonical key. Signed-off-by: disqualifier --- README.md | 4 ++-- src/aiowebhooks/sender.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 968ab3c..f463cfd 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,9 @@ send to the core — inheriting rotation, proxy, retry, and result for free. ## Install ``` -aiowebhooks @ git+ssh://git@git.rethinkstudios.io/rethink-public/aiowebhooks.git@v0.1.1 +aiowebhooks @ git+ssh://git@git.rethinkstudios.io/rethink-public/aiowebhooks.git@v0.1.2 # discord embeds / identity helpers need the extra: -aiowebhooks[discord] @ git+ssh://git@git.rethinkstudios.io/rethink-public/aiowebhooks.git@v0.1.1 +aiowebhooks[discord] @ git+ssh://git@git.rethinkstudios.io/rethink-public/aiowebhooks.git@v0.1.2 ``` The base pulls `aiohttp` and `commons` (for the retry/backoff engine). Only diff --git a/src/aiowebhooks/sender.py b/src/aiowebhooks/sender.py index 33c4406..a926bcb 100644 --- a/src/aiowebhooks/sender.py +++ b/src/aiowebhooks/sender.py @@ -49,12 +49,12 @@ def _proxy_string(proxies_dict: Optional[Dict[str, str]]) -> Optional[str]: if host is None: return None host = host.lower() - port = str(parts.port) if parts.port is not None else "" + hostport = f"{host}:{parts.port}" if parts.port is not None else host if parts.username: user = unquote(parts.username) password = unquote(parts.password) if parts.password is not None else "" - return f"{host}:{port}:{user}:{password}" - return f"{host}:{port}" + return f"{hostport}:{user}:{password}" + return hostport except ValueError: return None