Unified/Blob: Allow direct access to UIDs (#101339)
This commit is contained in:
@@ -1169,18 +1169,23 @@ func (s *server) GetBlob(ctx context.Context, req *GetBlobRequest) (*GetBlobResp
|
||||
}}, nil
|
||||
}
|
||||
|
||||
// The linked blob is stored in the resource metadata attributes
|
||||
obj, status := s.getPartialObject(ctx, req.Resource, req.ResourceVersion)
|
||||
if status != nil {
|
||||
return &GetBlobResponse{Error: status}, nil
|
||||
}
|
||||
var info *utils.BlobInfo
|
||||
if req.Uid == "" {
|
||||
// The linked blob is stored in the resource metadata attributes
|
||||
obj, status := s.getPartialObject(ctx, req.Resource, req.ResourceVersion)
|
||||
if status != nil {
|
||||
return &GetBlobResponse{Error: status}, nil
|
||||
}
|
||||
|
||||
info := obj.GetBlob()
|
||||
if info == nil || info.UID == "" {
|
||||
return &GetBlobResponse{Error: &ErrorResult{
|
||||
Message: "Resource does not have a linked blob",
|
||||
Code: 404,
|
||||
}}, nil
|
||||
info = obj.GetBlob()
|
||||
if info == nil || info.UID == "" {
|
||||
return &GetBlobResponse{Error: &ErrorResult{
|
||||
Message: "Resource does not have a linked blob",
|
||||
Code: 404,
|
||||
}}, nil
|
||||
}
|
||||
} else {
|
||||
info = &utils.BlobInfo{UID: req.Uid}
|
||||
}
|
||||
|
||||
rsp, err := s.blob.GetResourceBlob(ctx, req.Resource, info, req.MustProxyBytes)
|
||||
|
||||
Reference in New Issue
Block a user