mirror of
https://github.com/ffuf/ffuf
synced 2024-11-10 14:14:24 +00:00
Make regex filter match headers too
This commit is contained in:
parent
35f02c622b
commit
81c398eeb0
1 changed files with 9 additions and 1 deletions
|
@ -21,7 +21,15 @@ func NewRegexpFilter(value string) (ffuf.FilterProvider, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *RegexpFilter) Filter(response *ffuf.Response) (bool, error) {
|
func (f *RegexpFilter) Filter(response *ffuf.Response) (bool, error) {
|
||||||
return f.Value.Match(response.Data), nil
|
matchheaders := ""
|
||||||
|
for k, v := range response.Headers {
|
||||||
|
for _, iv := range v {
|
||||||
|
matchheaders += k + ": " + iv + "\r\n"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
matchdata := []byte(matchheaders)
|
||||||
|
matchdata = append(matchdata, response.Data...)
|
||||||
|
return f.Value.Match(matchdata), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *RegexpFilter) Repr() string {
|
func (f *RegexpFilter) Repr() string {
|
||||||
|
|
Loading…
Reference in a new issue