[O] CORS allow all

pull/14/head
Azalea 2024-02-19 01:37:50 -05:00
parent 7e9db5b52d
commit 94a3234874
1 changed files with 2 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package icu.samnyan.aqua.security.config;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.Customizer;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.SecurityFilterChain;
@ -33,7 +34,7 @@ public class SecurityConfig {
@Bean @Bean
public SecurityFilterChain configure(HttpSecurity http) throws Exception { public SecurityFilterChain configure(HttpSecurity http) throws Exception {
http.headers(headers -> headers.disable()) http.headers(headers -> headers.disable())
.cors(cors -> cors.disable()) .cors(Customizer.withDefaults())
.csrf(csrf -> csrf.disable()) .csrf(csrf -> csrf.disable())
.authorizeHttpRequests(authorize -> authorize.anyRequest().permitAll()); .authorizeHttpRequests(authorize -> authorize.anyRequest().permitAll());