Skip to content

fix: remove duplicated URL schema in proxy check (#52, #43)#57

Open
jundymek wants to merge 1 commit into
masterfrom
fix/issue-52-double-schema-url
Open

fix: remove duplicated URL schema in proxy check (#52, #43)#57
jundymek wants to merge 1 commit into
masterfrom
fix/issue-52-double-schema-url

Conversation

@jundymek

@jundymek jundymek commented Jun 9, 2026

Copy link
Copy Markdown
Owner

fix: remove duplicated URL schema in proxy check (#52, #43)

Problem

Since v1.1.3, FreeProxy(https=True).get() and any custom url= always failed with FreeProxyException: There are no working proxies at this time. — reported in #52 and #43.

Root cause

In __check_if_proxy_is_working, the test URL was built as:

url = f'{self.schema}://{self.url}'

But self.url already includes a schema (default 'https://www.google.com'). This produced a malformed double-schema URL:

Call URL actually requested
FreeProxy() http://https://www.google.com
FreeProxy(https=True) https://https://www.google.com
FreeProxy(url='http://httpbin.org/get') http://http://httpbin.org/get

Every proxy check raised on the malformed URL, so get() treated all proxies as dead and ultimately raised FreeProxyException. Regression introduced in 1.1.3 (#49) when the url parameter was added.

Fix

Use self.url directly, since it already carries its schema:

url = self.url

Tests

Added two regression tests (TDD — written first, confirmed failing before the fix):

  • test_check_uses_default_url_without_double_schema
  • test_check_uses_custom_url_without_double_schema
Check Result
Full suite — Python 3.9 ✅ 19/19
Full suite — Python 3.11 ✅ 19/19
Live FreeProxy(https=True).get() (was always failing per #52) ✅ returns a working proxy

Version

Patch bump 1.2.01.2.1 (bugfix, no API change). CHANGELOG and README badge updated.

Closes #52
Closes #43

@jundymek jundymek self-assigned this Jun 9, 2026
@jundymek jundymek added the bug Something isn't working label Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setting https=True in version 1.1.3 always fails failed to get proxy

2 participants