What's the cleanest way to include the RedirectHttpsFilter in production only?

Hello,

I built my application using the seed as base where the application Filters are specified using the utils.Filters class. Now I need to add the play.filters.https.RedirectHttpsFilter but I can not use the Play’s commended way of adding a new filter i.e.
play.api.http.filters += play.filters.https.RedirectHttpsFilter

because the filter is not a sequence but a class utils.Filters implementing the “Composite” pattern. Is there a more Play-ish idiomatic way to rewrite or replace the utils.Filters approach so that I can easily plug new filters from the conf files?

Many TIA,
Best regards,
Giovanni

Hi,

You can remove the utils.Filters class completely and add the filters with the config.

Best regards
Christian

Hi Christian,

Thank you for the answer. I will do it … I haven’t looked at Silhouette and Play for that matter in like 6 months so I am a bit rusty atm need to again review everything.

Best regards,
Giovanni