Skip to content

Commit 9e7614d

Browse files
committed
Fix deadlock in NewContext introduced in 3da094f.
1 parent cc45db1 commit 9e7614d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

digest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,9 @@ func (da *DigestAuth) JustCheck(wrapped http.HandlerFunc) http.HandlerFunc {
250250

251251
// NewContext returns a context carrying authentication information for the request.
252252
func (da *DigestAuth) NewContext(ctx context.Context, r *http.Request) context.Context {
253+
username, authinfo := da.CheckAuth(r)
253254
da.mutex.Lock()
254255
defer da.mutex.Unlock()
255-
username, authinfo := da.CheckAuth(r)
256256
info := &Info{Username: username, ResponseHeaders: make(http.Header)}
257257
if username != "" {
258258
info.Authenticated = true

0 commit comments

Comments
 (0)