mirror of
https://github.com/Rayzggz/server_torii.git
synced 2025-06-20 22:17:33 +08:00
feat: new action process
This commit is contained in:
17
internal/check/URLAllow.go
Normal file
17
internal/check/URLAllow.go
Normal file
@ -0,0 +1,17 @@
|
||||
package check
|
||||
|
||||
import (
|
||||
"server_torii/internal/action"
|
||||
"server_torii/internal/config"
|
||||
"server_torii/internal/dataType"
|
||||
)
|
||||
|
||||
func URLAllowList(reqData dataType.UserRequest, ruleSet *config.RuleSet, decision *action.Decision) {
|
||||
url := reqData.Uri
|
||||
list := ruleSet.URLAllowList
|
||||
if list.Match(url) {
|
||||
decision.SetCode(action.Done, "200")
|
||||
} else {
|
||||
decision.Set(action.Continue)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user