mirror of
https://github.com/octoleo/restic.git
synced 2024-11-16 10:05:25 +00:00
b9f0f031b6
Closes #2129
22 lines
392 B
Go
22 lines
392 B
Go
// +build go1.6
|
|
|
|
package swift
|
|
|
|
import (
|
|
"net/http"
|
|
"time"
|
|
)
|
|
|
|
const IS_AT_LEAST_GO_16 = true
|
|
|
|
func SetExpectContinueTimeout(tr *http.Transport, t time.Duration) {
|
|
tr.ExpectContinueTimeout = t
|
|
}
|
|
|
|
func AddExpectAndTransferEncoding(req *http.Request, hasContentLength bool) {
|
|
req.Header.Add("Expect", "100-continue")
|
|
if !hasContentLength {
|
|
req.TransferEncoding = []string{"chunked"}
|
|
}
|
|
}
|