From 12a6b6198771f20a0783156aef748ba10ea3bbf3 Mon Sep 17 00:00:00 2001 From: funilrys Date: Tue, 26 Mar 2024 17:24:57 +0100 Subject: [PATCH] Bugfix: Ensure that a URL is always set. 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 --- PyFunceble/checker/availability/base.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PyFunceble/checker/availability/base.py b/PyFunceble/checker/availability/base.py index 79eff61f..c4c0c335 100644 --- a/PyFunceble/checker/availability/base.py +++ b/PyFunceble/checker/availability/base.py @@ -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()