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:
parent
aec0a5cc2b
commit
bcf1f5511c
@ -13,9 +13,9 @@ send to the core — inheriting rotation, proxy, retry, and result for free.
|
|||||||
## Install
|
## 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:
|
# 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
|
The base pulls `aiohttp` and `commons` (for the retry/backoff engine). Only
|
||||||
|
|||||||
@ -49,12 +49,12 @@ def _proxy_string(proxies_dict: Optional[Dict[str, str]]) -> Optional[str]:
|
|||||||
if host is None:
|
if host is None:
|
||||||
return None
|
return None
|
||||||
host = host.lower()
|
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:
|
if parts.username:
|
||||||
user = unquote(parts.username)
|
user = unquote(parts.username)
|
||||||
password = unquote(parts.password) if parts.password is not None else ""
|
password = unquote(parts.password) if parts.password is not None else ""
|
||||||
return f"{host}:{port}:{user}:{password}"
|
return f"{hostport}:{user}:{password}"
|
||||||
return f"{host}:{port}"
|
return hostport
|
||||||
except ValueError:
|
except ValueError:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user