mirror of
https://github.com/restic/restic.git
synced 2025-12-02 13:02:48 +00:00
Merge pull request #5018 from MichaelEischer/rest-retry-http2-goaway
rest: improve handling of HTTP2 goaway
This commit is contained in:
@@ -143,6 +143,12 @@ func (b *Backend) Save(ctx context.Context, h backend.Handle, rd backend.RewindR
|
||||
if err != nil {
|
||||
return errors.WithStack(err)
|
||||
}
|
||||
req.GetBody = func() (io.ReadCloser, error) {
|
||||
if err := rd.Rewind(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return io.NopCloser(rd), nil
|
||||
}
|
||||
req.Header.Set("Content-Type", "application/octet-stream")
|
||||
req.Header.Set("Accept", ContentTypeV2)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user