mirror of
https://github.com/buger/goreplay.git
synced 2024-04-21 12:32:02 +00:00
Merge pull request #171 from buger/code-styling
Improve code documentation and styling
This commit is contained in:
+4
-4
@@ -88,9 +88,9 @@ func (m *HTTPModifier) Rewrite(payload []byte) (response []byte) {
|
||||
|
||||
if len(m.config.headerFilters) > 0 {
|
||||
for _, f := range m.config.headerFilters {
|
||||
value, s, _, _ := proto.Header(payload, f.name)
|
||||
value := proto.Header(payload, f.name)
|
||||
|
||||
if s != -1 && !f.regexp.Match(value) {
|
||||
if len(value) > 0 && !f.regexp.Match(value) {
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -108,9 +108,9 @@ func (m *HTTPModifier) Rewrite(payload []byte) (response []byte) {
|
||||
|
||||
if len(m.config.headerHashFilters) > 0 {
|
||||
for _, f := range m.config.headerHashFilters {
|
||||
value, s, _, _ := proto.Header(payload, f.name)
|
||||
value := proto.Header(payload, f.name)
|
||||
|
||||
if s != -1 {
|
||||
if len(value) > 0 {
|
||||
hasher := fnv.New32a()
|
||||
hasher.Write(value)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user