Skip to content

Commit

Permalink
Adding check only for metered accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
Ark2307 committed Dec 18, 2024
1 parent 1fe4baa commit 0026eac
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2842,12 +2842,16 @@ private static void addDefaultAdvancedFilters(BackwardCompatibility backwardComp
" value:\n" +
" regex: .*localhost.*";

if(!DashboardMode.isMetered()){
contentBlock = "id: DEFAULT_BLOCK_FILTER\nfilter:\n response_code:\n gte: 400";
}


AdvancedTrafficFiltersAction action = new AdvancedTrafficFiltersAction();
action.setYamlContent(contentAllow);
action.saveYamlTemplateForTrafficFilters();

if(backwardCompatibility.getAddDefaultFilters() != 0){
if(backwardCompatibility.getAddDefaultFilters() != 0 && DashboardMode.isMetered()){
Bson defaultFilterQ = Filters.eq(Constants.ID, "DEFAULT_BLOCK_FILTER");
YamlTemplate blockTemplate = AdvancedTrafficFiltersDao.instance.findOne(defaultFilterQ);
if((blockTemplate.getUpdatedAt() - blockTemplate.getCreatedAt()) <= 10){
Expand Down

0 comments on commit 0026eac

Please sign in to comment.