From e0a233c494b24038770dd7a6946b42bc054bee55 Mon Sep 17 00:00:00 2001 From: toranger Date: Wed, 17 Jul 2019 16:19:09 +0800 Subject: [PATCH] Add the check for anonymous user --- auth.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/auth.go b/auth.go index abc65bb..6b0cc55 100644 --- a/auth.go +++ b/auth.go @@ -142,6 +142,10 @@ func newAuthorization(secretID, secretKey string, req *http.Request, authTime *A // AddAuthorizationHeader 给 req 增加签名信息 func AddAuthorizationHeader(secretID, secretKey string, sessionToken string, req *http.Request, authTime *AuthTime) { + if secretID == "" { + return + } + auth := newAuthorization(secretID, secretKey, req, authTime, )