fix: login successed but popup Forbidden (#437)

This commit is contained in:
sigoden
2024-08-22 08:52:50 +08:00
committed by GitHub
parent 1db263efae
commit 7d17d9c415
4 changed files with 14 additions and 10 deletions

View File

@@ -429,6 +429,7 @@ fn is_readonly_method(method: &Method) -> bool {
|| method == Method::OPTIONS
|| method == Method::HEAD
|| method.as_str() == "PROPFIND"
|| method.as_str() == "AUTH"
}
fn strip_prefix<'a>(search: &'a [u8], prefix: &[u8]) -> Option<&'a [u8]> {

View File

@@ -200,7 +200,10 @@ impl Server {
.map(|(k, v)| (k.to_string(), v.to_string()))
.collect();
if method.as_str() == "WRITEABLE" {
if method.as_str() == "AUTH" {
if user.is_none() {
self.auth_reject(&mut res)?;
}
return Ok(res);
}