fix(webdav): fully working WebDAV RFC 4918 implementation

- Move WebDAV routes to top-level (out of /api nest) for proper path handling
- Add trailing slash routes and HEAD method support
- Refactor all 12 handlers to use Axum State extractor instead of req.extensions()
- Fix MOVE handler to support rename (same-folder move) via rename_file service
- Add Overwrite header support in MOVE/COPY operations
- Add extract_webdav_path() helper for consistent path parsing
- Add precondition_failed variant to AppError
- All 17 integration tests passing: OPTIONS, PROPFIND, MKCOL, PUT, GET, HEAD,
  PROPPATCH, COPY, MOVE, LOCK, DELETE (files and folders)
This commit is contained in:
Dionisio
2026-02-10 19:26:28 +01:00
parent ef9ed2cc31
commit 65f4e10236
4 changed files with 205 additions and 220 deletions
+5
View File
@@ -78,6 +78,11 @@ impl AppError {
pub fn unsupported_media_type(message: impl Into<String>) -> Self {
Self::new(StatusCode::UNSUPPORTED_MEDIA_TYPE, message, "UnsupportedMediaType")
}
/// Create a 412 Precondition Failed error.
pub fn precondition_failed(message: impl Into<String>) -> Self {
Self::new(StatusCode::PRECONDITION_FAILED, message, "PreconditionFailed")
}
}
impl From<DomainError> for AppError {