Skip to content

Commit b0f284c

Browse files
authored
Merge pull request #225 from xdev-software/develop
Release
2 parents 3b9f2d1 + c533cb1 commit b0f284c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 1.5.1
2+
* Fix HSTS customization logic not working as expected
3+
14
# 1.5.0
25
* Vaadin
36
* Made the way `HttpSecurity#securityMatcher` is applied in Sidecars customizable #221

web/src/main/java/software/xdev/sse/web/hsts/DefaultHstsApplier.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
import jakarta.annotation.Nullable;
1919

20+
import org.slf4j.Logger;
21+
import org.slf4j.LoggerFactory;
2022
import org.springframework.boot.web.server.Ssl;
2123
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
2224
import org.springframework.security.config.annotation.web.configurers.HeadersConfigurer;
@@ -40,14 +42,17 @@
4042
*/
4143
public class DefaultHstsApplier implements HstsApplier
4244
{
45+
private static final Logger LOG = LoggerFactory.getLogger(DefaultHstsApplier.class);
46+
4347
protected final boolean enabled;
4448

4549
public DefaultHstsApplier(
4650
final HstsConfig config,
4751
@Nullable final Ssl ssl)
4852
{
49-
this.enabled = !Boolean.FALSE.equals(config.isEnabled()) // true or null
53+
this.enabled = Boolean.TRUE.equals(config.isEnabled())
5054
|| ssl != null && ssl.isEnabled();
55+
LOG.debug("HSTS enabled={}", this.enabled);
5156
}
5257

5358
@Override

0 commit comments

Comments
 (0)