Skip to content

Commit

Permalink
support param regionList
Browse files Browse the repository at this point in the history
  • Loading branch information
taowei.wtw authored and kkuai committed Jul 9, 2021
1 parent ec0671b commit 2357498
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions oss/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ var signKeyList = []string{"acl", "uploads", "location", "cors",
"worm", "wormId", "wormExtend", "withHashContext",
"x-oss-enable-md5", "x-oss-enable-sha1", "x-oss-enable-sha256",
"x-oss-hash-ctx", "x-oss-md5-ctx", "transferAcceleration",
"regionList",
}

// init initializes Conn
Expand Down Expand Up @@ -182,7 +183,7 @@ func (conn Conn) getURLParams(params map[string]interface{}) string {
buf.WriteByte('&')
}
buf.WriteString(url.QueryEscape(k))
if params[k] != nil {
if params[k] != nil && params[k].(string) != "" {
buf.WriteString("=" + strings.Replace(url.QueryEscape(params[k].(string)), "+", "%20", -1))
}
}
Expand Down Expand Up @@ -218,7 +219,9 @@ func (conn Conn) getSubResource(params map[string]interface{}) string {
}
buf.WriteString(k)
if _, ok := signParams[k]; ok {
buf.WriteString("=" + signParams[k])
if signParams[k] != "" {
buf.WriteString("=" + signParams[k])
}
}
}
return buf.String()
Expand Down
2 changes: 1 addition & 1 deletion oss/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ const (

NullVersion = "null"

Version = "v2.1.8" // Go SDK version
Version = "v2.1.9alpha" // Go SDK version
)

// FrameType
Expand Down

0 comments on commit 2357498

Please sign in to comment.