diff options
author | Vladimir Shushlin <v.shushlin@gmail.com> | 2021-12-14 15:02:13 +0300 |
---|---|---|
committer | Vladimir Shushlin <v.shushlin@gmail.com> | 2021-12-14 17:11:30 +0300 |
commit | 097c4c0aec8ddb0028ed8be8ed338d87020c5a9b (patch) | |
tree | a1cb6d0b4b5ca99a0604d93a106b21a22d1b7dc4 /internal/redirects/matching.go | |
parent | cc23d6ef34be2fd5e6dff719dd1eb62a51b7a82f (diff) |
refactor: extract common logic for env feature flags
Diffstat (limited to 'internal/redirects/matching.go')
-rw-r--r-- | internal/redirects/matching.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/internal/redirects/matching.go b/internal/redirects/matching.go index b5bceb71..a75255bb 100644 --- a/internal/redirects/matching.go +++ b/internal/redirects/matching.go @@ -7,6 +7,8 @@ import ( netlifyRedirects "github.com/tj/go-redirects" "gitlab.com/gitlab-org/labkit/log" + + "gitlab.com/gitlab-org/gitlab-pages/internal/feature" ) var ( @@ -43,7 +45,7 @@ func matchesRule(rule *netlifyRedirects.Rule, path string) (bool, string) { // Any logic beyond this point handles placeholders and splats. // If the FF_ENABLE_PLACEHOLDERS feature flag isn't enabled, exit now. - if !placeholdersEnabled() { + if !feature.RedirectsPlaceholders.Enabled() { return false, "" } |