One function
_extract_proxy_url in CloakHQ/CloakBrowser
The author described this change as “fix: preserve HTTP proxy credentials during GeoIP resolution (#470)”. It counts as a record because the check below fails on the code as it stood at 093a66460 and passes on 3739d7bba, with nothing else changed between the two runs.
ProjectCloakHQ/CloakBrowser
Fix saved2026-07-27
Sharing licenceMIT · LICENSE
Change size+7 −4
What the code was meant to do, written into the code itself as a docstring
Extract and normalize proxy URL string from proxy param. For SOCKS5 dicts with separate username/password fields, reconstructs the full URL with inline credentials so SOCKS5 auth works.
The change
| 1 | 1 | def _extract_proxy_url(proxy: str | ProxySettings | None) -> str | None: | |
| 2 | 2 | """Extract and normalize proxy URL string from proxy param. | |
| 3 | 3 | ||
| 4 | - | For SOCKS5 dicts with separate username/password fields, reconstructs | |
| 5 | - | the full URL with inline credentials so SOCKS5 auth works. | |
| 4 | + | For proxy dicts with separate username/password fields, reconstructs | |
| 5 | + | the full URL with inline credentials so proxy auth works. | |
| 6 | 6 | """ | |
| 7 | 7 | if proxy is None: | |
| 8 | 8 | return None | |
| ⋯ | |||
| 10 | 10 | server = proxy.get("server", "") | |
| 11 | 11 | if not server: | |
| 12 | 12 | return None | |
| 13 | - | if _is_socks_proxy(proxy): | |
| 14 | - | return _reconstruct_socks_url(proxy) | |
| 13 | + | if proxy.get("username"): | |
| 14 | + | return ( | |
| 15 | + | _reconstruct_socks_url(proxy) if _is_socks_proxy(proxy) | |
| 16 | + | else _reconstruct_http_url(proxy) | |
| 17 | + | ) | |
| 15 | 18 | return _ensure_proxy_scheme(server) | |
| 16 | 19 | return _ensure_proxy_scheme(proxy) | |
The check that tells the two apart
fail→pass·tests/test_proxy.py::TestMaybeResolveGeoip::test_geoip_http_dict_reconstructs_credentials
Check file tests/test_proxy.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before it093a6646016f7068ff1bcf92a7ec4fd226f694b0
Broken version dated2026-07-26
Modulecloakbrowser.browser
Units changed_extract_proxy_url
Fingerprintff41f9378fe6b221
Checked2026-08-17 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in CloakHQ/CloakBrowser
- 2026-05-10_normalize_socks_string_url