diff --git a/cmd/proxy/actions/app.go b/cmd/proxy/actions/app.go index 0932cd5f2..9477d787f 100644 --- a/cmd/proxy/actions/app.go +++ b/cmd/proxy/actions/app.go @@ -113,7 +113,9 @@ func App() (*buffalo.App, error) { app.Stop(err) } app.Use(T.Middleware()) - app.Use(newFilterMiddleware(mf)) + if !env.FilterOff() { + app.Use(newFilterMiddleware(mf)) + } user, pass, ok := env.BasicAuth() if ok { app.Use(basicAuth(user, pass)) diff --git a/pkg/config/env/filter.go b/pkg/config/env/filter.go index d549a9d05..2d6da8c20 100644 --- a/pkg/config/env/filter.go +++ b/pkg/config/env/filter.go @@ -9,3 +9,11 @@ const defaultConfigurationFileName = "filter.conf" func FilterConfigurationFileName() string { return envy.Get("ATHENS_FILTER_FILENAME", defaultConfigurationFileName) } + +// FilterOff checks PROXY_FILTER_OFF env and returns +// true of it's equal to "true", otherwise false always. +// It defaults to "true" until Olympus is the default +// place to grab modules before the Proxy. +func FilterOff() bool { + return envy.Get("PROXY_FILTER_OFF", "true") == "true" +}