diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/LoadStmt.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/LoadStmt.java index 02b014fd26dab0..a565ea4c288d99 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/LoadStmt.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/LoadStmt.java @@ -572,7 +572,11 @@ public RedirectStatus getRedirectStatus() { private void checkEndpoint(String endpoint) throws UserException { HttpURLConnection connection = null; try { - String urlStr = "http://" + endpoint; + String urlStr = endpoint; + // Add default protocol if not specified + if (!endpoint.startsWith("http://") && !endpoint.startsWith("https://")) { + urlStr = "http://" + endpoint; + } SecurityChecker.getInstance().startSSRFChecking(urlStr); URL url = new URL(urlStr); connection = (HttpURLConnection) url.openConnection(); @@ -629,6 +633,8 @@ public void checkS3Param() throws UserException { } public void checkWhiteList(String endpoint) throws UserException { + endpoint = endpoint.replaceFirst("^http://", ""); + endpoint = endpoint.replaceFirst("^https://", ""); List whiteList = new ArrayList<>(Arrays.asList(Config.s3_load_endpoint_white_list)); whiteList.removeIf(String::isEmpty); if (!whiteList.isEmpty() && !whiteList.contains(endpoint)) {