When using the Swisscom CloudFoundry solution with a Spring Boot application, two Strict-Transport-Security
headers are added to a HTTPS response. I have looked into this issue, and found out that several headers are added by the CloudFoundry solution. Spring Boot, by default, already adds the Strict-Transport-Security
header too (on secure sites) which leads to two different HSTS headers.
I would like to configure the headers of my application within my application. Is there a way to disable this automatic header adding of the Swisscom CloudFoundry solution?
If not, is there a way to tell the Swisscom Cloud to overwrite existing Strict-Transport-Security
headers instead of appending it to the list of headers?
A HTTP response from the Spring Boot application, deployed the Swisscom Cloud, then contains the following two headers:
Strict-Transport-Security:max-age=31536000 ; includeSubDomains
Strict-Transport-Security:max-age=15768000; includeSubDomains