title: enable http strict transport security for spring boot application
body: <p>I have <code>Spring Boot</code> application running on server. All requests are done via HTTPS.</p>
  
  <p>I need to enable Strict Transport Security. I my <code>Spring Boot</code> configuration I enabled</p>
  
  <pre><code>.http
  ....
  .headers()
      .httpStrictTransportSecurity()
      .includeSubDomains(true)
      .maxAgeInSeconds(HSTS_MAX_AGE_365_DAYS);
  </code></pre>
  
  <p>And also added annotation <code>@EnableWebSecurity</code> to the configurer class. </p>
  
  <p>But still, no requests contain <code>strict-transport-security</code> header and also in <code>security</code> tab (in firefox) it is mentioned that transport security is disabled.</p>
  
  <p><a href="https://i.stack.imgur.com/MbJAz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MbJAz.png" alt="enter image description here"></a></p>
  
  <p>What is the problem? Why it is not enabled?</p>