title: How to add HTTP “Feature-Policy” header in Spring
body: <p>I need to add  HTTP “Feature-Policy” response header but I did not find any way implement this in spring in header like -</p>
  
  <pre class="lang-java prettyprint-override"><code>@EnableWebSecurity
  public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
  
      @Override
      protected void configure(HttpSecurity http) throws Exception {
          http
          // ...
          .headers()
              .contentSecurityPolicy("script-src 'self' https://trustedscripts.example.com; object-src https://trustedplugins.example.com; report-uri /csp-report-endpoint/");
      }
  </code></pre>
  
  <p>I can see the draft specification <a href="https://docs.google.com/document/d/1k0Ua-ZWlM_PsFCFdLMa8kaVTo32PeNZ4G7FFHqpFx4E/edit#" rel="nofollow noreferrer">here</a> but not much about use it in Spring. Any suggestion will be appreciated.</p>