使用java配置,跟spring security配置在一起

@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http
            // ...
            .headers().frameOptions().sameOrigin().httpStrictTransportSecurity().disable();
    }
}

如果是使用xml配置:

<http>
    <!-- ... -->

    <headers>
        <frame-options policy="SAMEORIGIN" />
        <hsts disable="true"/>
    </headers>
</http>

 

相关文章:

  • 2021-05-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-25
  • 2022-12-23
  • 2021-11-20
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-24
  • 2021-10-02
  • 2021-11-18
  • 2022-12-23
相关资源
相似解决方案