forked from TrueCloudLab/frostfs-node
[#1258] audit: Fix panic in LogRequest method
* Make `LogRequest` process `req=nil` to avoid panic. Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
parent
eadcea8df0
commit
e377a92d97
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