Browse Source

update auth signed header

master
jojoliang 3 years ago
parent
commit
2d8b119e76
  1. 8
      auth.go

8
auth.go

@ -29,7 +29,7 @@ var (
)
// 需要校验的 Headers 列表
var needSignHeaders = map[string]bool{
var NeedSignHeaders = map[string]bool{
"host": true,
"range": true,
"x-cos-acl": true,
@ -65,6 +65,10 @@ var ciParameters = map[string]bool{
"imageview2/": true,
}
func SetNeedSignHeaders(key string, val bool) {
NeedSignHeaders[key] = val
}
func safeURLEncode(s string) string {
s = encodeURIComponent(s)
s = strings.Replace(s, "!", "%21", -1)
@ -275,7 +279,7 @@ func isCIParameter(key string) bool {
}
func isSignHeader(key string) bool {
for k, v := range needSignHeaders {
for k, v := range NeedSignHeaders {
if key == k && v {
return true
}

Loading…
Cancel
Save