Skip to content

Commit

Permalink
apply review;
Browse files Browse the repository at this point in the history
  • Loading branch information
m.gougam committed Apr 17, 2023
1 parent f556ae7 commit 6b15dc5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/extensions/nginx-app-protect/monitoring/processor/nap.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,13 +449,13 @@ func (f *NAPConfig) getViolations(logger *logrus.Entry) []*models.ViolationData
value = v.HeaderData.Value
} else if v.HeaderLength != "" {
isB64Decoded = true
decodedValue, err := base64.StdEncoding.DecodeString(v.HeaderName)
decodedName, err := base64.StdEncoding.DecodeString(v.HeaderName)
if err != nil {
logger.Errorf("could not decode the Header %s for %v", v.HeaderName, f.SupportID)
break
}
name = fmt.Sprintf("Header length: %s, exceeds Header length limit: %s", v.HeaderLength, v.HeaderLengthLimit)
value = string(decodedValue)
name = string(decodedName)
value = fmt.Sprintf("Header length: %s, exceeds Header length limit: %s", v.HeaderLength, v.HeaderLengthLimit)
}

if isB64Decoded {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -870,8 +870,8 @@ func TestNAPProcess(t *testing.T) {
Name: "VIOL_HEADER_LENGTH",
Context: "header",
ContextData: &pb.ContextData{
Name: "Header length: 42, exceeds Header length limit: 10",
Value: "Host: dflkdjfldkfldkfldkflkdflkdflkdlfkdlf",
Name: "Host: dflkdjfldkfldkfldkflkdflkdflkdlfkdlf",
Value: "Header length: 42, exceeds Header length limit: 10",
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
"Name": "VIOL_HEADER_LENGTH",
"Context": "header",
"ContextData": {
"Name": "Header length: 42, exceeds Header length limit: 10",
"Value": "Host: dflkdjfldkfldkfldkflkdflkdflkdlfkdlf"
"Name": "Host: dflkdjfldkfldkfldkflkdflkdflkdlfkdlf",
"Value": "Header length: 42, exceeds Header length limit: 10"
}
}
]
Expand Down

0 comments on commit 6b15dc5

Please sign in to comment.