Skip to content
This repository was archived by the owner on Jun 21, 2022. It is now read-only.

Commit 9d6d311

Browse files
committed
small optimization: using strings.Contains instead regexp.MatchString
1 parent 12e4990 commit 9d6d311

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

authorization.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"hash"
1010
"io"
1111
"net/url"
12-
"regexp"
1312
"strings"
1413
"time"
1514
)
@@ -105,7 +104,7 @@ func (ah *authorization) computeA1(dr *DigestRequest) string {
105104

106105
func (ah *authorization) computeA2(dr *DigestRequest) string {
107106

108-
if matched, _ := regexp.MatchString("auth-int", dr.Wa.Qop); matched {
107+
if strings.Contains(dr.Wa.Qop, "auth-int") {
109108
ah.Qop = "auth-int"
110109
return fmt.Sprintf("%s:%s:%s", dr.Method, ah.URI, ah.hash(dr.Body))
111110
}

0 commit comments

Comments
 (0)