diff --git a/internal/feature/feature.go b/internal/feature/feature.go index 1b97e935ad0f857f20a8756d968ab340ace8a0e8..89735b7088f5ee13a588d0b03fb9c467a654046f 100644 --- a/internal/feature/feature.go +++ b/internal/feature/feature.go @@ -35,13 +35,13 @@ var HandleReadErrors = Feature{ // ProjectPrefixCookiePath enables support for path in session cookie var ProjectPrefixCookiePath = Feature{ EnvVariable: "FF_ENABLE_PROJECT_PREFIX_COOKIE_PATH", - defaultEnabled: false, + defaultEnabled: true, } // DomainRedirects enables support for domain level redirects var DomainRedirects = Feature{ EnvVariable: "FF_ENABLE_DOMAIN_REDIRECT", - defaultEnabled: false, + defaultEnabled: true, } // RateLimiterCloseConnection enables support for rate limiter close connection diff --git a/internal/redirects/matching_test.go b/internal/redirects/matching_test.go index 3938b6803feb7d6989df1ee96bb9f11b7e980c5f..b022c984f3eb23944c0afe80f372a36fc3efdd85 100644 --- a/internal/redirects/matching_test.go +++ b/internal/redirects/matching_test.go @@ -315,6 +315,7 @@ func testMatchesRule(t *testing.T) { } func Test_matchesRule(t *testing.T) { + t.Setenv(feature.DomainRedirects.EnvVariable, "false") testMatchesRule(t) } diff --git a/internal/redirects/validations_test.go b/internal/redirects/validations_test.go index 13f115cd34a015676b7d097d9cc03f152d2333aa..a295fb4387ee50c77ac255181d74504a027f81b2 100644 --- a/internal/redirects/validations_test.go +++ b/internal/redirects/validations_test.go @@ -75,6 +75,7 @@ func TestRedirectsValidateFromUrl(t *testing.T) { func TestRedirectsValidateToUrl(t *testing.T) { t.Setenv(feature.RedirectsPlaceholders.EnvVariable, "true") + t.Setenv(feature.DomainRedirects.EnvVariable, "false") tests := map[string]struct { url string @@ -162,6 +163,7 @@ func TestRedirectsValidateUrlNoPlaceholders(t *testing.T) { func TestRedirectsValidateRule(t *testing.T) { t.Setenv(feature.RedirectsPlaceholders.EnvVariable, "true") + t.Setenv(feature.DomainRedirects.EnvVariable, "false") tests := map[string]struct { rule string @@ -208,6 +210,7 @@ func TestRedirectsValidateRule(t *testing.T) { func TestRedirectsValidateFromUrl_DomainRedirect_Enabled(t *testing.T) { t.Setenv(feature.RedirectsPlaceholders.EnvVariable, "true") + t.Setenv(feature.DomainRedirects.EnvVariable, "true") tests := map[string]struct { url string diff --git a/test/acceptance/redirects_test.go b/test/acceptance/redirects_test.go index 5c7f765ae4216ce654f2eebdbb91d9fe1e42a0c1..6f8b7592962ee4afda5a204891b14301fc191081 100644 --- a/test/acceptance/redirects_test.go +++ b/test/acceptance/redirects_test.go @@ -64,7 +64,8 @@ func testRedirect(t *testing.T, tests []rewrite) { } } -func TestRedirect(t *testing.T) { +func TestRedirect_DomainRedirects_Disabled(t *testing.T) { + t.Setenv(feature.DomainRedirects.EnvVariable, "false") tests := []rewrite{ // Project domain {