mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-15 07:35:49 -06:00
No HTTP/2
This commit is contained in:
parent
2235d44726
commit
874bdcf9f1
1 changed files with 13 additions and 1 deletions
14
s3/client.go
14
s3/client.go
|
|
@ -4,6 +4,7 @@ import (
|
|||
"bytes"
|
||||
"context"
|
||||
"crypto/md5" //nolint:gosec // MD5 is required by the S3 protocol for Content-MD5 headers
|
||||
"crypto/tls"
|
||||
"encoding/base64"
|
||||
"encoding/xml"
|
||||
"errors"
|
||||
|
|
@ -61,7 +62,18 @@ type Client struct {
|
|||
func New(config *Config) *Client {
|
||||
httpClient := config.HTTPClient
|
||||
if httpClient == nil {
|
||||
httpClient = http.DefaultClient
|
||||
// Force HTTP/1.1 to avoid HTTP/2 stream errors with S3-compatible providers
|
||||
// (e.g. DigitalOcean Spaces). HTTP/2 can cause non-retryable failures on
|
||||
// streaming uploads when the server resets the stream mid-transfer.
|
||||
httpClient = &http.Client{
|
||||
Transport: &http.Transport{
|
||||
TLSClientConfig: &tls.Config{
|
||||
MinVersion: tls.VersionTLS12,
|
||||
},
|
||||
ForceAttemptHTTP2: false,
|
||||
TLSNextProto: make(map[string]func(string, *tls.Conn) http.RoundTripper),
|
||||
},
|
||||
}
|
||||
}
|
||||
return &Client{
|
||||
config: config,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue