File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
web/src/main/java/software/xdev/sse/web/hsts Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 1- # 1.5.1
2- * Fix HSTS customization logic not working as expected
1+ # 1.5.2
2+ * Improve default HSTS customization logic
33
44# 1.5.0
55* Vaadin
Original file line number Diff line number Diff line change @@ -50,11 +50,21 @@ public DefaultHstsApplier(
5050 final HstsConfig config ,
5151 @ Nullable final Ssl ssl )
5252 {
53- this .enabled = Boolean .TRUE .equals (config .isEnabled ())
54- || ssl != null && ssl .isEnabled ();
53+ this .enabled = determineIfEnabled (config , ssl );
5554 LOG .debug ("HSTS enabled={}" , this .enabled );
5655 }
5756
57+ protected static boolean determineIfEnabled (
58+ final HstsConfig config ,
59+ @ Nullable final Ssl ssl )
60+ {
61+ if (config != null && config .isEnabled () != null )
62+ {
63+ return config .isEnabled ();
64+ }
65+ return ssl != null && ssl .isEnabled ();
66+ }
67+
5868 @ Override
5969 public HeadersConfigurer <HttpSecurity > apply (final HeadersConfigurer <HttpSecurity > c )
6070 {
You can’t perform that action at this time.
0 commit comments