Allow retrying HTTP/2 uploads for release assets
The `Request.GetBody` func allows the retry mechanism to reopen the file
that's being uploaded as the request body in case the body of the
previous request has already started to be read.
Hopefully fixes the error:
http2: Transport: cannot retry err [stream error: stream ID 1; REFUSED_STREAM]
after Request.Body was written; define Request.GetBody to avoid this error
Ref. d523dce5a7/http2/transport.go (L554)
This commit is contained in:
parent
8480381d13
commit
40da8f9c69
1 changed files with 1 additions and 0 deletions
|
|
@ -170,6 +170,7 @@ func uploadAsset(httpClient *http.Client, uploadURL string, asset AssetForUpload
|
|||
}
|
||||
req.ContentLength = asset.Size
|
||||
req.Header.Set("Content-Type", asset.MIMEType)
|
||||
req.GetBody = asset.Open
|
||||
|
||||
resp, err := httpClient.Do(req)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue