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

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


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 4cb66f3a406 branch-2.1: [chore](http) return NOT_FOUND if dir is not 
exists #51897 (#52156)
4cb66f3a406 is described below

commit 4cb66f3a40616b78124f430ab56dfc46ed6806e2
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Jun 24 10:39:28 2025 +0800

    branch-2.1: [chore](http) return NOT_FOUND if dir is not exists #51897 
(#52156)
    
    Cherry-picked from #51897
    
    Co-authored-by: walter <[email protected]>
---
 be/src/http/utils.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/be/src/http/utils.cpp b/be/src/http/utils.cpp
index aeb7fe702cc..63b51726959 100644
--- a/be/src/http/utils.cpp
+++ b/be/src/http/utils.cpp
@@ -200,7 +200,13 @@ void do_dir_response(const std::string& dir_path, 
HttpRequest* req, bool is_acqu
         return;
     }
 
-    VLOG_DEBUG << "list dir: " << dir_path << ", file count: " << files.size();
+    VLOG_DEBUG << "list dir: " << dir_path << ", exists: " << exists
+               << ", file count: " << files.size();
+
+    if (!exists) {
+        HttpChannel::send_error(req, HttpStatus::NOT_FOUND);
+        return;
+    }
 
     const std::string FILE_DELIMITER_IN_DIR_RESPONSE = "\n";
 


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

Reply via email to