Skip to content

Commit 0eb2546

Browse files
committed
fixed possible performance regression due to failure to cache compilation results
1 parent 0eebbe7 commit 0eb2546

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/main/java/org/owasp/html/HtmlPolicyBuilder.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,9 @@ public String apply(String url) {
817817
elementName,
818818
elPolicy, attrs.build(), skipIfEmpty.contains(elementName)));
819819
}
820-
return new CompiledState(globalAttrPolicies, policiesBuilder.build());
820+
compiledState = new CompiledState(
821+
globalAttrPolicies, policiesBuilder.build());
822+
return compiledState;
821823
}
822824

823825
/**

0 commit comments

Comments
 (0)