This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new f142279a779 branch-4.0: [fix](storage vault) fix Azure Storage Vault 
endpoint always using HTTP instead of HTTPS #60854 (#60861)
f142279a779 is described below

commit f142279a77912540f68cba33de06f1840024b07a
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Feb 27 17:57:04 2026 +0800

    branch-4.0: [fix](storage vault) fix Azure Storage Vault endpoint always 
using HTTP instead of HTTPS #60854 (#60861)
    
    Cherry-picked from #60854
    
    Co-authored-by: hui lai <[email protected]>
---
 .../org/apache/doris/catalog/AzureResource.java    |  4 +-
 .../apache/doris/catalog/AzureResourceTest.java    | 55 ++++++++++++++++++++++
 2 files changed, 57 insertions(+), 2 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/catalog/AzureResource.java 
b/fe/fe-core/src/main/java/org/apache/doris/catalog/AzureResource.java
index 54477da2db4..165e69720e9 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/AzureResource.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/AzureResource.java
@@ -68,8 +68,8 @@ public class AzureResource extends Resource {
 
         // the endpoint for ping need add uri scheme.
         String pingEndpoint = this.properties.get(S3Properties.ENDPOINT);
-        if (!pingEndpoint.startsWith("http://";)) {
-            pingEndpoint = "http://"; + 
this.properties.get(S3Properties.ENDPOINT);
+        if (!pingEndpoint.contains("://")) {
+            pingEndpoint = "https://"; + pingEndpoint;
             this.properties.put(S3Properties.ENDPOINT, pingEndpoint);
             this.properties.put(S3Properties.Env.ENDPOINT, pingEndpoint);
         }
diff --git 
a/fe/fe-core/src/test/java/org/apache/doris/catalog/AzureResourceTest.java 
b/fe/fe-core/src/test/java/org/apache/doris/catalog/AzureResourceTest.java
index cbf50d6cc58..3e3c05f5454 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/catalog/AzureResourceTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/catalog/AzureResourceTest.java
@@ -20,6 +20,7 @@ package org.apache.doris.catalog;
 import org.apache.doris.common.DdlException;
 
 import com.google.common.base.Strings;
+import com.google.common.collect.ImmutableMap;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.junit.jupiter.api.Assertions;
@@ -54,4 +55,58 @@ public class AzureResourceTest {
             Assertions.assertTrue(false, e.getMessage());
         }
     }
+
+    @Test
+    public void testEndpointSchemeHandling() throws DdlException {
+        // Test 1: endpoint without scheme should get https:// prefix
+        AzureResource resource1 = new AzureResource("test1");
+        Map<String, String> props1 = new HashMap<>();
+        props1.put("s3.endpoint", "myaccount.blob.core.windows.net");
+        props1.put("s3.region", "eu-west-1");
+        props1.put("s3.access_key", "myaccount");
+        props1.put("s3.secret_key", "mysecret");
+        props1.put("s3.bucket", "mybucket");
+        props1.put("s3.root.path", "mypath");
+        props1.put("provider", "AZURE");
+        props1.put("s3_validity_check", "false");
+        resource1.setProperties(ImmutableMap.copyOf(props1));
+        Map<String, String> result1 = resource1.getCopiedProperties();
+        Assertions.assertEquals("https://myaccount.blob.core.windows.net";,
+                result1.get("s3.endpoint"),
+                "Endpoint without scheme should get https:// prefix");
+
+        // Test 2: endpoint with https:// should remain unchanged
+        AzureResource resource2 = new AzureResource("test2");
+        Map<String, String> props2 = new HashMap<>();
+        props2.put("s3.endpoint", "https://myaccount.blob.core.windows.net";);
+        props2.put("s3.region", "eu-west-1");
+        props2.put("s3.access_key", "myaccount");
+        props2.put("s3.secret_key", "mysecret");
+        props2.put("s3.bucket", "mybucket");
+        props2.put("s3.root.path", "mypath");
+        props2.put("provider", "AZURE");
+        props2.put("s3_validity_check", "false");
+        resource2.setProperties(ImmutableMap.copyOf(props2));
+        Map<String, String> result2 = resource2.getCopiedProperties();
+        Assertions.assertEquals("https://myaccount.blob.core.windows.net";,
+                result2.get("s3.endpoint"),
+                "Endpoint with https:// should remain unchanged");
+
+        // Test 3: endpoint with http:// should remain unchanged
+        AzureResource resource3 = new AzureResource("test3");
+        Map<String, String> props3 = new HashMap<>();
+        props3.put("s3.endpoint", "http://myaccount.blob.core.windows.net";);
+        props3.put("s3.region", "eu-west-1");
+        props3.put("s3.access_key", "myaccount");
+        props3.put("s3.secret_key", "mysecret");
+        props3.put("s3.bucket", "mybucket");
+        props3.put("s3.root.path", "mypath");
+        props3.put("provider", "AZURE");
+        props3.put("s3_validity_check", "false");
+        resource3.setProperties(ImmutableMap.copyOf(props3));
+        Map<String, String> result3 = resource3.getCopiedProperties();
+        Assertions.assertEquals("http://myaccount.blob.core.windows.net";,
+                result3.get("s3.endpoint"),
+                "Endpoint with http:// should remain unchanged");
+    }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to