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 <dev@disqualifier.me>
This commit is contained in:
disqualifier 2026-06-28 17:18:28 -04:00
parent aec0a5cc2b
commit bcf1f5511c
2 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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