From e443b02acf494239d9360a878b254dd231980d91 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 24 May 2022 10:34:29 +0000 Subject: [PATCH] auth/imap: close IMAP connection earlier No need to keep it around after Authenticate succeeds while handling the HTTP request (via next.ServeHTTP). --- auth/imap.go | 1 + 1 file changed, 1 insertion(+) diff --git a/auth/imap.go b/auth/imap.go index 268cedf..ca1bd0c 100644 --- a/auth/imap.go +++ b/auth/imap.go @@ -57,6 +57,7 @@ func (prov *IMAPProvider) doAuth(next http.Handler, http.Error(w, "Invalid username or password", http.StatusUnauthorized) return } + conn.Close() authCtx := AuthContext{ AuthMethod: "imap",