fix: remove Method::Options auth check (#168)

* fix: remove Method::Options auth check

* add tests

---------

Co-authored-by: sigoden <sigoden@gmail.com>
This commit is contained in:
horizon
2023-02-19 12:30:14 +08:00
committed by GitHub
parent 47883376c1
commit 0000bd27f5
2 changed files with 15 additions and 0 deletions

View File

@@ -82,6 +82,11 @@ impl AccessControl {
if self.rules.is_empty() {
return GuardType::ReadWrite;
}
if method == Method::OPTIONS {
return GuardType::ReadOnly;
}
let mut controls = vec![];
for path in walk_path(path) {
if let Some(control) = self.rules.get(path) {