From c1051059f482eb4ec2351cd0f720407077127e68 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 19 Sep 2020 21:05:41 +0200 Subject: [PATCH] proxy: fix empty regex field being interpreted as regex --- proxy/pkg/server/api_bundle.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/proxy/pkg/server/api_bundle.go b/proxy/pkg/server/api_bundle.go index b5c6b192a..38b40ed48 100644 --- a/proxy/pkg/server/api_bundle.go +++ b/proxy/pkg/server/api_bundle.go @@ -51,8 +51,10 @@ func (pb *providerBundle) prepareOpts(provider *models.ProxyOutpostConfig) *opti providerOpts.OIDCJwksURL = *provider.OidcConfiguration.JwksURI providerOpts.ProfileURL = *provider.OidcConfiguration.UserinfoEndpoint - skipRegexes := strings.Split(provider.SkipPathRegex, "\n") - providerOpts.SkipAuthRegex = skipRegexes + if provider.SkipPathRegex != "" { + skipRegexes := strings.Split(provider.SkipPathRegex, "\n") + providerOpts.SkipAuthRegex = skipRegexes + } providerOpts.UpstreamServers = []options.Upstream{ {