mirror of
https://github.com/sigoden/dufs.git
synced 2026-04-09 00:59:02 +03:00
chore: optimize for test auth
This commit is contained in:
@@ -138,9 +138,6 @@ impl GuardType {
|
||||
pub fn is_reject(&self) -> bool {
|
||||
*self == GuardType::Reject
|
||||
}
|
||||
pub fn is_readwrite(&self) -> bool {
|
||||
*self == GuardType::ReadWrite
|
||||
}
|
||||
}
|
||||
|
||||
fn sanitize_path(path: &str, uri_prefix: &str) -> String {
|
||||
|
||||
@@ -149,10 +149,7 @@ impl Server {
|
||||
.map(|(k, v)| (k.to_string(), v.to_string()))
|
||||
.collect();
|
||||
|
||||
if query_params.contains_key("auth") {
|
||||
if !guard_type.is_readwrite() {
|
||||
self.auth_reject(&mut res);
|
||||
}
|
||||
if method.as_str() == "WRITEABLE" {
|
||||
return Ok(res);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user