lib/checker: Implement X-Original-URI support (#1015)

This commit is contained in:
Skyler Mäntysaari 2025-08-24 06:14:37 +03:00 committed by GitHub
parent f3cd6c9ca4
commit d1d631a18a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 101 additions and 0 deletions

View file

@ -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
}