diff --git a/oauthproxy_test.go b/oauthproxy_test.go index 44025465..c087cff3 100644 --- a/oauthproxy_test.go +++ b/oauthproxy_test.go @@ -2396,7 +2396,7 @@ func Test_buildRoutesAllowlist(t *testing.T) { shouldError: false, }, { - name: "Mixed method and domain routes", + name: "Mixed method and domain routes", skipAuthRegex: []string{}, skipAuthRoutes: []string{ "GET=^/api/v1", diff --git a/pkg/validation/allowlist.go b/pkg/validation/allowlist.go index 91addf5e..4b44dac8 100644 --- a/pkg/validation/allowlist.go +++ b/pkg/validation/allowlist.go @@ -36,15 +36,8 @@ func validateAuthRoutes(o *options.Options) []string { if len(parts) == 1 { regex = parts[0] } else { - // Check if this is a domain-based route - prefix := strings.ToLower(parts[0]) - if prefix == "domain" { - // For domain routes, validate the domain regex - regex = parts[1] - } else { - // For method-based routes, validate the path regex - regex = parts[1] - } + // For method or domain-based routes, validate the regex + regex = parts[1] } _, err := regexp.Compile(regex) if err != nil {