Browse Source

feat: cross origin PATCH 추가

pull/19/head
지대한 2 months ago
parent
commit
fc4a1ee94f
  1. 8
      pav-server/src/main/java/com/palnet/biz/config/WebSecurityConfig.java

8
pav-server/src/main/java/com/palnet/biz/config/WebSecurityConfig.java

@ -82,8 +82,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
public CorsConfigurationSource corsConfigurationSource() {
CorsConfiguration configuration = new CorsConfiguration();
configuration.setAllowedOrigins(Arrays.asList("*"));
configuration.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE","OPTIONS"));
configuration.setAllowedHeaders(Arrays.asList("x-timezone","Accept-Language","Accept","X-Requested-With", "Content-Type", "Authorization", "X-XSRF-token"));
configuration.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"));
configuration.setAllowedHeaders(Arrays.asList("x-timezone", "Accept-Language", "Accept", "X-Requested-With", "Content-Type", "Authorization", "X-XSRF-token"));
configuration.setAllowCredentials(false);
configuration.setMaxAge(3600L);
@ -112,8 +112,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
.cors(cors -> corsConfigurationSource())
// dont authenticate this particular request
.authorizeRequests()
.antMatchers(HttpMethod.OPTIONS,"/api/**").permitAll()
.antMatchers(HttpMethod.GET,"/ping").permitAll()
.antMatchers(HttpMethod.OPTIONS, "/api/**").permitAll()
.antMatchers(HttpMethod.GET, "/ping").permitAll()
.antMatchers("/swagger-ui/**").permitAll()
.antMatchers(PERMITTED_URL).permitAll()
// all other requests need to be authenticated

Loading…
Cancel
Save