Skip to content

Commit

Permalink
Merge pull request #914 from ffurano/master
Browse files Browse the repository at this point in the history
Don't assume that a header "Depth: 1" means that the resource is a dir
  • Loading branch information
ffurano committed Feb 27, 2019
2 parents e53ebf6 + cf4536d commit 00b69a1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/XrdHttp/XrdHttpReq.cc
Expand Up @@ -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
Expand Down Expand Up @@ -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 = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<D:multistatus xmlns:D=\"DAV:\" xmlns:ns1=\"http://apache.org/dav/props/\" xmlns:ns0=\"DAV:\">\n";
stringresp.insert(0, s);
stringresp += "</D:multistatus>\n";
Expand Down

0 comments on commit 00b69a1

Please sign in to comment.