Skip to content

Commit a1a3fc5

Browse files
committed
rekor: do not cancel http context
The context must be valid for the entire lifetime of the request including reading the body, as such it is invalid to return the body after cancelling the context, depending of if all the response data arrived already or not this then might fail. To fix this simply do not cancel the context here, we could move the cancel() up to the caller function that processes the body. However as that one already closes the body there should be no need to cancel the context to end the request. Fixes: #2936 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
1 parent 3532547 commit a1a3fc5

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

signature/sigstore/rekor/openapi_infra.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ import (
2828

2929
// makeRequest makes a http request to the requested requestPath, and returns the received response.
3030
func (r *rekorClient) makeRequest(ctx context.Context, method, requestPath string, bodyContent any) (*http.Response, error) {
31-
ctx, cancel := context.WithCancel(ctx)
32-
defer cancel()
33-
3431
var body io.Reader
3532
headers := http.Header{}
3633

0 commit comments

Comments
 (0)