Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Commit

Permalink
search: report - ContentType: application/xml
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuAlfageme committed Jan 24, 2023
1 parent 732bd8b commit 5ad8a99
Showing 1 changed file with 2 additions and 154 deletions.
156 changes: 2 additions & 154 deletions internal/http/services/owncloud/ocdav/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,162 +110,10 @@ func (s *svc) doSearchFiles(w http.ResponseWriter, r *http.Request, sf *reportSe
}

data := `
<d:multistatus xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns" xmlns:s="http://sabredav.org/ns">
<d:response>
<d:href>/remote.php/dav/files/cboxbot/eos/project/a/awesomeproject/New%20Text%20Document.txt</d:href>
<d:propstat>
<d:prop>
<oc:fileid>newproject-a!420307062</oc:fileid>
<oc:file-parent>newproject-a!616510</oc:file-parent>
<oc:name>New Text Document.txt</oc:name>
<d:getlastmodified>2022-12-05T16:12:20Z</d:getlastmodified>
<d:getcontenttype>text/plain</d:getcontenttype>
<oc:permissions>SRDNVCKZ</oc:permissions>
<d:getetag />
<d:resourcetype>
<d:collection />
</d:resourcetype>
<oc:size>0</oc:size>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
<d:response>
<d:href>/remote.php/dav/files/cboxbot/eos/project/a/awesomeproject/New%20text%20file.txt</d:href>
<d:propstat>
<d:prop>
<oc:fileid>newproject-a!166399624</oc:fileid>
<oc:file-parent>newproject-a!616510</oc:file-parent>
<oc:name>New text file.txt</oc:name>
<d:getlastmodified>2022-12-05T16:12:20Z</d:getlastmodified>
<d:getcontenttype>text/plain</d:getcontenttype>
<oc:permissions>SRDNVCKZ</oc:permissions>
<d:getetag />
<d:resourcetype>
<d:collection />
</d:resourcetype>
<oc:size>5</oc:size>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
<d:response>
<d:href>/remote.php/dav/files/cboxbot/eos/project/a/awesomeproject/recover.txt</d:href>
<d:propstat>
<d:prop>
<oc:fileid>newproject-a!493427700</oc:fileid>
<oc:file-parent>newproject-a!616510</oc:file-parent>
<oc:name>recover.txt</oc:name>
<d:getlastmodified>2022-12-05T16:12:20Z</d:getlastmodified>
<d:getcontenttype>text/plain</d:getcontenttype>
<oc:permissions>SRDNVCKZ</oc:permissions>
<d:getetag />
<d:resourcetype>
<d:collection />
</d:resourcetype>
<oc:size>0</oc:size>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
<d:response>
<d:href>/remote.php/dav/files/cboxbot/eos/project/a/awesomeproject/test_support.txt</d:href>
<d:propstat>
<d:prop>
<oc:fileid>newproject-a!420300390</oc:fileid>
<oc:file-parent>newproject-a!616510</oc:file-parent>
<oc:name>test_support.txt</oc:name>
<d:getlastmodified>2022-12-05T16:12:20Z</d:getlastmodified>
<d:getcontenttype>text/plain</d:getcontenttype>
<oc:permissions>SRDNVCKZ</oc:permissions>
<d:getetag />
<d:resourcetype>
<d:collection />
</d:resourcetype>
<oc:size>0</oc:size>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
<d:response>
<d:href>/remote.php/dav/files/cboxbot/eos/project/a/awesomeproject/testing.txt</d:href>
<d:propstat>
<d:prop>
<oc:fileid>newproject-a!420300167</oc:fileid>
<oc:file-parent>newproject-a!616510</oc:file-parent>
<oc:name>testing.txt</oc:name>
<d:getlastmodified>2022-12-05T16:12:20Z</d:getlastmodified>
<d:getcontenttype>text/plain</d:getcontenttype>
<oc:permissions>SRDNVCKZ</oc:permissions>
<d:getetag />
<d:resourcetype>
<d:collection />
</d:resourcetype>
<oc:size>0</oc:size>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
<d:response>
<d:href>/remote.php/dav/files/cboxbot/eos/project/a/awesomeproject/testing2.txt</d:href>
<d:propstat>
<d:prop>
<oc:fileid>newproject-a!420300326</oc:fileid>
<oc:file-parent>newproject-a!616510</oc:file-parent>
<oc:name>testing2.txt</oc:name>
<d:getlastmodified>2022-12-05T16:12:20Z</d:getlastmodified>
<d:getcontenttype>text/plain</d:getcontenttype>
<oc:permissions>SRDNVCKZ</oc:permissions>
<d:getetag />
<d:resourcetype>
<d:collection />
</d:resourcetype>
<oc:size>0</oc:size>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
<d:response>
<d:href>/remote.php/dav/files/cboxbot/eos/project/a/awesomeproject/Denied%20Folder/New%20file.txt</d:href>
<d:propstat>
<d:prop>
<oc:fileid>newproject-a!437033942</oc:fileid>
<oc:file-parent>newproject-a!67942728</oc:file-parent>
<oc:name>New file.txt</oc:name>
<d:getlastmodified>2022-12-05T16:12:20Z</d:getlastmodified>
<d:getcontenttype>text/plain</d:getcontenttype>
<oc:permissions>SRDNVCKZ</oc:permissions>
<d:getetag />
<d:resourcetype>
<d:collection />
</d:resourcetype>
<oc:size>0</oc:size>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
<d:response>
<d:href>/remote.php/dav/files/cboxbot/eos/project/a/awesomeproject/test_versions/test.txt</d:href>
<d:propstat>
<d:prop>
<oc:fileid>newproject-a!506354963</oc:fileid>
<oc:file-parent>newproject-a!73758625</oc:file-parent>
<oc:name>test.txt</oc:name>
<d:getlastmodified>2022-12-05T16:12:20Z</d:getlastmodified>
<d:getcontenttype>text/plain</d:getcontenttype>
<oc:permissions>SRDNVCKZ</oc:permissions>
<d:getetag />
<d:resourcetype>
<d:collection />
</d:resourcetype>
<oc:size>9</oc:size>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
</d:multistatus>
<d:multistatus xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns" xmlns:s="http://sabredav.org/ns"><d:response><d:href>/remote.php/dav/files/cboxbot/eos/project/a/awesomeproject/New%20Text%20Document.txt</d:href><d:propstat><d:prop><oc:fileid>newproject-a!420307062</oc:fileid><oc:file-parent>newproject-a!616510</oc:file-parent><oc:name>New Text Document.txt</oc:name><d:getlastmodified>2022-12-05T16:12:20Z</d:getlastmodified><d:getcontenttype>text/plain</d:getcontenttype><oc:permissions>SRDNVCKZ</oc:permissions><d:getetag /><d:resourcetype><d:collection /></d:resourcetype><oc:size>0</oc:size></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/remote.php/dav/files/cboxbot/eos/project/a/awesomeproject/New%20text%20file.txt</d:href><d:propstat><d:prop><oc:fileid>newproject-a!166399624</oc:fileid><oc:file-parent>newproject-a!616510</oc:file-parent><oc:name>New text file.txt</oc:name><d:getlastmodified>2022-12-05T16:12:20Z</d:getlastmodified><d:getcontenttype>text/plain</d:getcontenttype><oc:permissions>SRDNVCKZ</oc:permissions><d:getetag /><d:resourcetype><d:collection /></d:resourcetype><oc:size>5</oc:size></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/remote.php/dav/files/cboxbot/eos/project/a/awesomeproject/recover.txt</d:href><d:propstat><d:prop><oc:fileid>newproject-a!493427700</oc:fileid><oc:file-parent>newproject-a!616510</oc:file-parent><oc:name>recover.txt</oc:name><d:getlastmodified>2022-12-05T16:12:20Z</d:getlastmodified><d:getcontenttype>text/plain</d:getcontenttype><oc:permissions>SRDNVCKZ</oc:permissions><d:getetag /><d:resourcetype><d:collection /></d:resourcetype><oc:size>0</oc:size></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/remote.php/dav/files/cboxbot/eos/project/a/awesomeproject/test_support.txt</d:href><d:propstat><d:prop><oc:fileid>newproject-a!420300390</oc:fileid><oc:file-parent>newproject-a!616510</oc:file-parent><oc:name>test_support.txt</oc:name><d:getlastmodified>2022-12-05T16:12:20Z</d:getlastmodified><d:getcontenttype>text/plain</d:getcontenttype><oc:permissions>SRDNVCKZ</oc:permissions><d:getetag /><d:resourcetype><d:collection /></d:resourcetype><oc:size>0</oc:size></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/remote.php/dav/files/cboxbot/eos/project/a/awesomeproject/testing.txt</d:href><d:propstat><d:prop><oc:fileid>newproject-a!420300167</oc:fileid><oc:file-parent>newproject-a!616510</oc:file-parent><oc:name>testing.txt</oc:name><d:getlastmodified>2022-12-05T16:12:20Z</d:getlastmodified><d:getcontenttype>text/plain</d:getcontenttype><oc:permissions>SRDNVCKZ</oc:permissions><d:getetag /><d:resourcetype><d:collection /></d:resourcetype><oc:size>0</oc:size></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/remote.php/dav/files/cboxbot/eos/project/a/awesomeproject/testing2.txt</d:href><d:propstat><d:prop><oc:fileid>newproject-a!420300326</oc:fileid><oc:file-parent>newproject-a!616510</oc:file-parent><oc:name>testing2.txt</oc:name><d:getlastmodified>2022-12-05T16:12:20Z</d:getlastmodified><d:getcontenttype>text/plain</d:getcontenttype><oc:permissions>SRDNVCKZ</oc:permissions><d:getetag /><d:resourcetype><d:collection /></d:resourcetype><oc:size>0</oc:size></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/remote.php/dav/files/cboxbot/eos/project/a/awesomeproject/Denied%20Folder/New%20file.txt</d:href><d:propstat><d:prop><oc:fileid>newproject-a!437033942</oc:fileid><oc:file-parent>newproject-a!67942728</oc:file-parent><oc:name>New file.txt</oc:name><d:getlastmodified>2022-12-05T16:12:20Z</d:getlastmodified><d:getcontenttype>text/plain</d:getcontenttype><oc:permissions>SRDNVCKZ</oc:permissions><d:getetag /><d:resourcetype><d:collection /></d:resourcetype><oc:size>0</oc:size></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/remote.php/dav/files/cboxbot/eos/project/a/awesomeproject/test_versions/test.txt</d:href><d:propstat><d:prop><oc:fileid>newproject-a!506354963</oc:fileid><oc:file-parent>newproject-a!73758625</oc:file-parent><oc:name>test.txt</oc:name><d:getlastmodified>2022-12-05T16:12:20Z</d:getlastmodified><d:getcontenttype>text/plain</d:getcontenttype><oc:permissions>SRDNVCKZ</oc:permissions><d:getetag /><d:resourcetype><d:collection /></d:resourcetype><oc:size>9</oc:size></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response></d:multistatus>
`
w.Write([]byte(data))
w.Header().Add("Content-Type", "application/xml")
w.WriteHeader(207)
return
}
Expand Down

0 comments on commit 5ad8a99

Please sign in to comment.