mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-25 01:26:40 +00:00
lib/checker: Implement X-Original-URI support (#1015)
This commit is contained in:
committed by
GitHub
parent
f3cd6c9ca4
commit
d1d631a18a
@@ -102,6 +102,13 @@ func NewPathChecker(rexStr string) (checker.Impl, error) {
|
||||
}
|
||||
|
||||
func (pc *PathChecker) Check(r *http.Request) (bool, error) {
|
||||
originalUrl := r.Header.Get("X-Original-URI")
|
||||
if originalUrl != "" {
|
||||
if pc.regexp.MatchString(originalUrl) {
|
||||
return true, nil
|
||||
}
|
||||
}
|
||||
|
||||
if pc.regexp.MatchString(r.URL.Path) {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user