Fix: return proper http status and error when writing to read-only files

This commit is contained in:
Zef Hemel
2026-07-23 16:11:04 +02:00
parent 21ebd23086
commit e0cd96ab10
6 changed files with 22 additions and 17 deletions
+1
View File
@@ -30,6 +30,7 @@ pub(crate) fn space_error_response(e: SpaceError) -> Response {
SpaceError::NotFound => (StatusCode::NOT_FOUND, "404 page not found\n".to_string()),
SpaceError::PathOutsideRoot => (StatusCode::FORBIDDEN, e.to_string()),
SpaceError::Unauthorized => (StatusCode::UNAUTHORIZED, e.to_string()),
SpaceError::ReadOnly(_) => (StatusCode::FORBIDDEN, e.to_string()),
_ => (StatusCode::INTERNAL_SERVER_ERROR, e.to_string()),
};
Response::builder()