Skip to content

Commit 17f64b8

Browse files
committed
fix: sdk-go http client Location from Asia/Shanghai to UTC
1 parent 0d74fd6 commit 17f64b8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

zstack-sdk-go/pkg/client/zstack_http_client.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,11 @@ func (cli *ZSHttpClient) getAccessKeyHeader(url, method string) (http.Header, er
548548

549549
header := http.Header{}
550550

551-
loc, _ := time.LoadLocation("Asia/Shanghai")
552-
date := time.Now().In(loc).Format("Mon, 02 Jan 2006 15:04:05 MST")
551+
//loc, _ := time.LoadLocation("Asia/Shanghai")
552+
//date := time.Now().In(loc).Format("Mon, 02 Jan 2006 15:04:05 MST")
553+
554+
loc, _ := time.LoadLocation("UTC")
555+
date := time.Now().In(loc).Format("Mon, 02 Jan 2006 15:04:05 UTC")
553556

554557
contextPath := fmt.Sprintf("/%s", cli.contextPath)
555558
uri := url[strings.Index(url, contextPath)+len(contextPath):]

0 commit comments

Comments
 (0)