mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-06 22:30:56 +03:00
webdav: add a test case for PROPFIND with infinity Depth
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -2223,6 +2223,17 @@ func TestGETAsPROPFIND(t *testing.T) {
|
||||
files, err = client.ReadDir(subDir1)
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, files, 1)
|
||||
// PROPFIND with infinity depth is forbidden
|
||||
req, err = http.NewRequest(http.MethodGet, rootPath, nil)
|
||||
if assert.NoError(t, err) {
|
||||
req.SetBasicAuth(u.Username, u.Password)
|
||||
req.Header.Set("Depth", "infinity")
|
||||
resp, err := httpClient.Do(req)
|
||||
if assert.NoError(t, err) {
|
||||
assert.Equal(t, http.StatusForbidden, resp.StatusCode)
|
||||
resp.Body.Close()
|
||||
}
|
||||
}
|
||||
|
||||
_, err = httpdtest.RemoveUser(user, http.StatusOK)
|
||||
assert.NoError(t, err)
|
||||
|
||||
Reference in New Issue
Block a user