fix: strange issue that occurs only on Microsoft WebDAV (#382)

This commit is contained in:
sigoden
2024-05-11 16:18:18 +08:00
committed by GitHub
parent 75f06f749c
commit cb7d417fd3
2 changed files with 25 additions and 6 deletions

View File

@@ -100,6 +100,7 @@ impl AccessControl {
path: &str,
method: &Method,
authorization: Option<&HeaderValue>,
guard_options: bool,
) -> (Option<String>, Option<AccessPaths>) {
if let Some(authorization) = authorization {
if let Some(user) = get_auth_user(authorization) {
@@ -116,7 +117,7 @@ impl AccessControl {
return (None, None);
}
if method == Method::OPTIONS {
if !guard_options && method == Method::OPTIONS {
return (None, Some(AccessPaths::new(AccessPerm::ReadOnly)));
}