Fix --http-allow-header to filter non existent headers

Fix https://github.com/buger/goreplay/issues/604
This commit is contained in:
Leonid Bugaev
2019-01-24 23:47:14 +01:00
parent 7b0f81b82f
commit fb3870d68c
+5 -1
View File
@@ -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
}
}