mirror of
https://github.com/sigoden/dufs.git
synced 2026-04-09 00:59:02 +03:00
fix: status code for MKCOL on existing resource (#142)
* Fix status code for MKCOL on existing resource Per https://datatracker.ietf.org/doc/html/rfc4918#section-9.3.1, MKCOL should return a 405 if the resource already exists. Impetus for this change: I am using dufs as a webdav server for [Joplin](https://joplinapp.org/) which interpreted the previous behavior of returning a 403 as an error, preventing syncing from working. * add test Co-authored-by: sigoden <sigoden@gmail.com>
This commit is contained in:
@@ -93,6 +93,13 @@ fn mkcol_not_allow_upload(server: TestServer) -> Result<(), Error> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
fn mkcol_already_exists(#[with(&["-A"])] server: TestServer) -> Result<(), Error> {
|
||||
let resp = fetch!(b"MKCOL", format!("{}dira", server.url())).send()?;
|
||||
assert_eq!(resp.status(), 405);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
fn copy_file(#[with(&["-A"])] server: TestServer) -> Result<(), Error> {
|
||||
let new_url = format!("{}test2.html", server.url());
|
||||
|
||||
Reference in New Issue
Block a user