mirror of
https://github.com/buger/goreplay.git
synced 2024-04-21 12:32:02 +00:00
Fix --http-allow-header to filter non existent headers
Fix https://github.com/buger/goreplay/issues/604
This commit is contained in:
+5
-1
@@ -98,7 +98,11 @@ func (m *HTTPModifier) Rewrite(payload []byte) (response []byte) {
|
||||
for _, f := range m.config.headerFilters {
|
||||
value := proto.Header(payload, f.name)
|
||||
|
||||
if len(value) > 0 && !f.regexp.Match(value) {
|
||||
if len(value) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
if !f.regexp.Match(value) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user