Skip to content

Commit 4aa4d2e

Browse files
committed
internal/gomote: add object name to UploadFile endpoint
This change adds the object name as one of the fields returned to the caller. The object name is not included in the URL. The object name is required for any subsequent calls needed to pass the file along to the gomote instances. For golang/go#47521 Updates golang/go#48742 Change-Id: I5437ab2029907460806f2f3b6a19f6dec22115da Reviewed-on: https://go-review.googlesource.com/c/build/+/405535 TryBot-Result: Gopher Robot <[email protected]> Auto-Submit: Carlos Amedee <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Carlos Amedee <[email protected]> Run-TryBot: Carlos Amedee <[email protected]>
1 parent adda295 commit 4aa4d2e

File tree

3 files changed

+109
-94
lines changed

3 files changed

+109
-94
lines changed

internal/gomote/gomote.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,14 +401,16 @@ func (s *Server) UploadFile(ctx context.Context, req *protos.UploadFileRequest)
401401
if err != nil {
402402
return nil, status.Errorf(codes.Unauthenticated, "request does not contain the required authentication")
403403
}
404-
url, fields, err := s.signURLForUpload(uuid.NewString())
404+
objectName := uuid.NewString()
405+
url, fields, err := s.signURLForUpload(objectName)
405406
if err != nil {
406407
log.Printf("unable to create signed URL: %s", err)
407408
return nil, status.Errorf(codes.Internal, "unable to create signed url")
408409
}
409410
return &protos.UploadFileResponse{
410-
Url: url,
411-
Fields: fields,
411+
Url: url,
412+
Fields: fields,
413+
ObjectName: objectName,
412414
}, nil
413415
}
414416

0 commit comments

Comments
 (0)