satellite/metainfo: check if EncryptedMetadataNonce was set
It possible that old uplinks won't set it. Change-Id: Ifd3c4d4a45c5636cfeb70b0a37bcf1305a097727
This commit is contained in:
parent
a30f5d7ec0
commit
70b1c7aa17
@ -857,10 +857,13 @@ func (endpoint *Endpoint) getObject(ctx context.Context, projectID uuid.UUID, bu
|
||||
expires = *metaObject.ExpiresAt
|
||||
}
|
||||
|
||||
nonce, err := storj.NonceFromBytes(metaObject.EncryptedMetadataNonce)
|
||||
if err != nil {
|
||||
endpoint.log.Error("internal", zap.Error(err))
|
||||
return nil, rpcstatus.Error(rpcstatus.Internal, err.Error())
|
||||
var nonce storj.Nonce
|
||||
if len(metaObject.EncryptedMetadataNonce) > 0 {
|
||||
nonce, err = storj.NonceFromBytes(metaObject.EncryptedMetadataNonce)
|
||||
if err != nil {
|
||||
endpoint.log.Error("internal", zap.Error(err))
|
||||
return nil, rpcstatus.Error(rpcstatus.Internal, err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
streamMeta := &pb.StreamMeta{}
|
||||
|
Loading…
Reference in New Issue
Block a user