From cf4536d41f3b5011ee57da695e43ae9639fcf288 Mon Sep 17 00:00:00 2001 From: Fabrizio Furano Date: Wed, 27 Feb 2019 16:28:15 +0100 Subject: [PATCH] Don't assume that a header "Depth: 1" means that the resource is a directory --- src/XrdHttp/XrdHttpReq.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/XrdHttp/XrdHttpReq.cc b/src/XrdHttp/XrdHttpReq.cc index bb7e1e8d8e4..30af45e5703 100644 --- a/src/XrdHttp/XrdHttpReq.cc +++ b/src/XrdHttp/XrdHttpReq.cc @@ -2189,10 +2189,12 @@ int XrdHttpReq::PostProcessHTTPReq(bool final_) { case 0: // response to stat() { - + DirListInfo e; + e.size = 0; + e.flags = 0; + // Now parse the answer building the entries vector if (iovN > 0) { - DirListInfo e; e.path = resource.c_str(); // Now parse the stat info @@ -2254,7 +2256,7 @@ int XrdHttpReq::PostProcessHTTPReq(bool final_) { } // If this was the last bunch of entries, send the buffer and empty it immediately - if (depth == 0) { + if ((depth == 0) || !(e.flags & kXR_isDir)) { string s = "\n\n"; stringresp.insert(0, s); stringresp += "\n";