From 94bd1924c02c55207f33a4372009ba5cee3a7994 Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Tue, 16 Apr 2024 18:31:46 -0300 Subject: [PATCH] l402: remove unnecessary regexp MatchString call The same regexp is then used in a call of FindStringSubmatch method and the outcome is the same, if nothing is found there. --- l402/header.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/l402/header.go b/l402/header.go index 3470bd2..bca5419 100644 --- a/l402/header.go +++ b/l402/header.go @@ -56,9 +56,6 @@ func FromHeader(header *http.Header) (*macaroon.Macaroon, lntypes.Preimage, erro for _, authHeader := range authHeaders { log.Debugf("Trying to authorize with header value "+ "[%s].", authHeader) - if !authRegex.MatchString(authHeader) { - continue - } matches = authRegex.FindStringSubmatch(authHeader) if len(matches) != 4 { continue