Skip to content

Commit

Permalink
BACKLOG-22157 Check both default and per site config for dry run (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
AKarmanov authored Jan 17, 2024
1 parent 7eee63f commit 95a83f8
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,15 @@ public boolean configExists(String siteKey) {

@Override
public boolean htmlSanitizerDryRun(String siteKey) {
if (configExists(siteKey)) {
JSONObject f = configs.get(siteKeyToPid.get(siteKey)).getJSONObject("htmlFiltering");
JSONObject f = new JSONObject();

return f.has("htmlSanitizerDryRun") && f.getBoolean("htmlSanitizerDryRun");
if (configExists(siteKey)) {
f = configs.get(siteKeyToPid.get(siteKey)).getJSONObject("htmlFiltering");
} else if ((configExists(DEFAULT_POLICY_KEY))) {
f = configs.get(siteKeyToPid.get(DEFAULT_POLICY_KEY)).getJSONObject("htmlFiltering");
}

return false;
return f.has("htmlSanitizerDryRun") && f.getBoolean("htmlSanitizerDryRun");
}

private void mergeJsonObject(JSONObject target, JSONObject source) {
Expand Down

0 comments on commit 95a83f8

Please sign in to comment.