You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
461 B
26 lines
461 B
package client
|
|
|
|
import (
|
|
"github.com/qiniu/go-sdk/v7/conf"
|
|
"net/http"
|
|
"time"
|
|
)
|
|
|
|
const (
|
|
RequestHeaderKeyXQiniuDate = "X-Qiniu-Date"
|
|
)
|
|
|
|
func addDefaultHeader(headers http.Header) error {
|
|
return addXQiniuDate(headers)
|
|
}
|
|
|
|
func addXQiniuDate(headers http.Header) error {
|
|
if conf.IsDisableQiniuTimestampSignature() {
|
|
return nil
|
|
}
|
|
|
|
timeString := time.Now().UTC().Format("20060102T150405Z")
|
|
headers.Set(RequestHeaderKeyXQiniuDate, timeString)
|
|
return nil
|
|
}
|