HstsSpec methods return this

HstsSpec methods maxAge and includeSubdomains use to return void
which broke using it as a fluent API.

The methods now return HstsSpec which fixes this issue.

Fixes: gh-5483
This commit is contained in:
Mahan Hashemizadeh
2018-07-04 16:25:22 +02:00
committed by Rob Winch
parent 998d1a064b
commit 555512e1f0
2 changed files with 7 additions and 4 deletions

View File

@@ -110,8 +110,9 @@ public class HeaderSpecTests {
public void headersWhenHstsCustomThenCustomHstsWritten() {
this.expectedHeaders.remove(StrictTransportSecurityServerHttpHeadersWriter.STRICT_TRANSPORT_SECURITY);
this.expectedHeaders.add(StrictTransportSecurityServerHttpHeadersWriter.STRICT_TRANSPORT_SECURITY, "max-age=60");
this.headers.hsts().maxAge(Duration.ofSeconds(60));
this.headers.hsts().includeSubdomains(false);
this.headers.hsts()
.maxAge(Duration.ofSeconds(60))
.includeSubdomains(false);
assertHeaders();
}