audit: Fix panic in LogRequest method #1258
1 changed files with 5 additions and 1 deletions
|
@ -18,7 +18,11 @@ type Target interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
func LogRequest(log *logger.Logger, operation string, req Request, target Target, status bool) {
|
func LogRequest(log *logger.Logger, operation string, req Request, target Target, status bool) {
|
||||||
LogRequestWithKey(log, operation, req.GetVerificationHeader().GetBodySignature().GetKey(), target, status)
|
var key []byte
|
||||||
|
if req != nil {
|
||||||
|
key = req.GetVerificationHeader().GetBodySignature().GetKey()
|
||||||
|
}
|
||||||
|
LogRequestWithKey(log, operation, key, target, status)
|
||||||
}
|
}
|
||||||
|
|
||||||
func LogRequestWithKey(log *logger.Logger, operation string, key []byte, target Target, status bool) {
|
func LogRequestWithKey(log *logger.Logger, operation string, key []byte, target Target, status bool) {
|
||||||
|
|
Loading…
Reference in a new issue