Skip to content

Commit

Permalink
Bugfix: Ensure that a URL is always set.
Browse files Browse the repository at this point in the history
This patch touches #358.

Indeed, before this patch, the special rules may have been
unstable when testing domains (not URL).
This patch fixes the issue by ensuring that our http_status_code
lookup is always done against a URL - if the testeted subject is
not an http(s) URL.

Contributors:
  * @spirillen
  • Loading branch information
funilrys committed Mar 26, 2024
1 parent 16fc910 commit 12a6b61
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions PyFunceble/checker/availability/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,10 @@ def try_to_query_status_from_http_status_code(
self.http_status_code_query_tool.set_subject(
f"http://{self.idna_subject}:80"
)
elif not self.idna_subject.startswith("http"):
self.http_status_code_query_tool.set_subject(
f"http://{self.idna_subject}:80"
)

lookup_result = self.http_status_code_query_tool.get_status_code()

Expand Down

1 comment on commit 12a6b61

@spirillen
Copy link
Contributor

@spirillen spirillen commented on 12a6b61 Mar 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great :)

Please sign in to comment.