强制通道的安全性(https)
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/spitter/me").hasRole("SPITTER")
.antMatchers(HttpMethod.POST, "/spittles").hasRole("SPITTER")
.anyRequest().permitAll()
.and()
.requeresChannel()
.antMatchers("/spitter/form").requiresSecure();
}.antMatchers("/").requiresInecure();Last updated