feat(checker): port other checkers over

Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
Xe Iaso
2025-07-25 18:45:54 +00:00
parent 178c60cf72
commit 1c43349c4a
21 changed files with 556 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
package headermatches
import (
"net/http"
"regexp"
)
type Checker struct {
header string
regexp *regexp.Regexp
hash string
}
func (c *Checker) Check(r *http.Request) (bool, error) {
if c.regexp.MatchString(r.Header.Get(c.header)) {
return true, nil
}
return false, nil
}
func (c *Checker) Hash() string {
return c.hash
}