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.
This commit is contained in:
Boris Nagaev
2024-04-16 18:31:46 -03:00
parent 7579f92a08
commit 94bd1924c0

View File

@@ -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