mirror of
https://github.com/rclone/rclone.git
synced 2024-11-30 04:15:26 +01:00
24 lines
418 B
Go
24 lines
418 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) {
|
|
if req.Body != nil {
|
|
req.Header.Add("Expect", "100-continue")
|
|
}
|
|
if !hasContentLength {
|
|
req.TransferEncoding = []string{"chunked"}
|
|
}
|
|
}
|