File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -133,14 +133,17 @@ func parseChallenge(input string) (*challenge, error) {
133
133
return nil , ErrDigestBadChallenge
134
134
}
135
135
s = strings .Trim (s [7 :], ws )
136
- sl := strings .Split (s , ", " )
136
+ sl := strings .Split (s , "," )
137
137
c := & challenge {}
138
138
var r []string
139
139
for i := range sl {
140
+ sl [i ] = strings .TrimSpace (sl [i ])
140
141
r = strings .SplitN (sl [i ], "=" , 2 )
141
142
if len (r ) != 2 {
142
143
return nil , ErrDigestBadChallenge
143
144
}
145
+ r [0 ] = strings .TrimSpace (r [0 ])
146
+ r [1 ] = strings .TrimSpace (r [1 ])
144
147
switch r [0 ] {
145
148
case "realm" :
146
149
c .realm = strings .Trim (r [1 ], qs )
@@ -151,9 +154,9 @@ func parseChallenge(input string) (*challenge, error) {
151
154
case "opaque" :
152
155
c .opaque = strings .Trim (r [1 ], qs )
153
156
case "stale" :
154
- c .stale = r [1 ]
157
+ c .stale = strings . Trim ( r [1 ], qs )
155
158
case "algorithm" :
156
- c .algorithm = r [1 ]
159
+ c .algorithm = strings . Trim ( r [1 ], qs )
157
160
case "qop" :
158
161
c .qop = strings .Trim (r [1 ], qs )
159
162
case "charset" :
You can’t perform that action at this time.
0 commit comments