From fd6c5491b6390535f1cbb2964159f0336d4960a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tufan=20Bar=C4=B1s=CC=A7=20YILDIRIM?= Date: Wed, 12 May 2021 17:14:58 +0300 Subject: [PATCH 1/3] check for schema separator instead of http, https://github.com/nsqio/nsq/pull/1341#issuecomment-839065228 --- internal/auth/authorizations.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/auth/authorizations.go b/internal/auth/authorizations.go index 4508fb734..a3cd05424 100644 --- a/internal/auth/authorizations.go +++ b/internal/auth/authorizations.go @@ -107,7 +107,7 @@ func QueryAuthd(authd string, remoteIP string, tlsEnabled bool, commonName strin v.Set("common_name", commonName) var endpoint string - if strings.HasPrefix(authd, "http") { + if strings.Contains(authd,"://"){ endpoint = fmt.Sprintf("%s?%s", authd, v.Encode()) } else { endpoint = fmt.Sprintf("http://%s/auth?%s", authd, v.Encode()) From 37c281745280f363938c505a2989e61643d04043 Mon Sep 17 00:00:00 2001 From: Pierce Lopez Date: Wed, 12 May 2021 11:22:37 -0400 Subject: [PATCH 2/3] fixup formatting --- internal/auth/authorizations.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/auth/authorizations.go b/internal/auth/authorizations.go index a3cd05424..becdb841f 100644 --- a/internal/auth/authorizations.go +++ b/internal/auth/authorizations.go @@ -107,7 +107,7 @@ func QueryAuthd(authd string, remoteIP string, tlsEnabled bool, commonName strin v.Set("common_name", commonName) var endpoint string - if strings.Contains(authd,"://"){ + if strings.Contains(authd, "://"){ endpoint = fmt.Sprintf("%s?%s", authd, v.Encode()) } else { endpoint = fmt.Sprintf("http://%s/auth?%s", authd, v.Encode()) From 19a913cad66e1597a6a9f1ae11bf3013d48e5d1c Mon Sep 17 00:00:00 2001 From: Pierce Lopez Date: Wed, 12 May 2021 11:23:11 -0400 Subject: [PATCH 3/3] fixup formatting more --- internal/auth/authorizations.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/auth/authorizations.go b/internal/auth/authorizations.go index becdb841f..246b021a9 100644 --- a/internal/auth/authorizations.go +++ b/internal/auth/authorizations.go @@ -107,7 +107,7 @@ func QueryAuthd(authd string, remoteIP string, tlsEnabled bool, commonName strin v.Set("common_name", commonName) var endpoint string - if strings.Contains(authd, "://"){ + if strings.Contains(authd, "://") { endpoint = fmt.Sprintf("%s?%s", authd, v.Encode()) } else { endpoint = fmt.Sprintf("http://%s/auth?%s", authd, v.Encode())