From ecdabe780031da1a3e999d02e248bb48f20482f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=81=E3=83=AD?= Date: Fri, 31 May 2024 23:26:15 +0900 Subject: [PATCH 1/3] disable url schema check when host is localhost --- src/client.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client.rs b/src/client.rs index 5c69457..e12d774 100644 --- a/src/client.rs +++ b/src/client.rs @@ -196,7 +196,9 @@ impl ClientBuilder { let session = self.session.build()?; let max_attempt = self.max_attempt; - if self.auth.is_some() && session.url.scheme() == "http" { + if self.auth.is_some() + && (session.url.scheme() == "http" && session.url.host_str() != Some("localhost")) + { return Err(Error::BasicAuthWithHttp); } From c45a7981180e686f2067e1544b48da9b41b3ff0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=81=E3=83=AD?= Date: Sat, 1 Jun 2024 14:12:29 +0900 Subject: [PATCH 2/3] Disabled validation when making requests to the trino domain. --- src/client.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client.rs b/src/client.rs index e12d774..7718c8e 100644 --- a/src/client.rs +++ b/src/client.rs @@ -197,7 +197,9 @@ impl ClientBuilder { let max_attempt = self.max_attempt; if self.auth.is_some() - && (session.url.scheme() == "http" && session.url.host_str() != Some("localhost")) + && (session.url.scheme() == "http" + && !(session.url.host_str() == Some("localhost") + && session.url.host_str() == Some("trino"))) { return Err(Error::BasicAuthWithHttp); } From 33fb94af02d8483d2b35881e5fdc0451c3f374e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=81=E3=83=AD?= Date: Sat, 1 Jun 2024 15:23:22 +0900 Subject: [PATCH 3/3] fix bug --- src/client.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client.rs b/src/client.rs index 7718c8e..1d04278 100644 --- a/src/client.rs +++ b/src/client.rs @@ -199,7 +199,7 @@ impl ClientBuilder { if self.auth.is_some() && (session.url.scheme() == "http" && !(session.url.host_str() == Some("localhost") - && session.url.host_str() == Some("trino"))) + || session.url.host_str() == Some("trino"))) { return Err(Error::BasicAuthWithHttp); }