Skip to content

Commit

Permalink
๐Ÿž BugFix: CORS ์„ค์ • ์ „์ฒด ํ—ˆ์šฉ์œผ๋กœ ๋ณ€๊ฒฝ (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnsugyeong authored Apr 20, 2024
1 parent 3d292f0 commit b6a5b90
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package zzangdol.moodoodleapi.global.config;

import java.util.Arrays;
import java.util.Collections;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
Expand Down Expand Up @@ -59,7 +60,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
@Bean
public CorsConfigurationSource corsConfigurationSource() {
CorsConfiguration configuration = new CorsConfiguration();
configuration.setAllowedOrigins(Arrays.asList("http://localhost:3000"));
configuration.setAllowedOrigins(Collections.singletonList("*")); // ๋ชจ๋“  ๋„๋ฉ”์ธ์—์„œ์˜ ์ ‘๊ทผ์„ ํ—ˆ์šฉํ•ฉ๋‹ˆ๋‹ค.
configuration.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE", "OPTIONS"));
configuration.setAllowedHeaders(Arrays.asList("Authorization", "Cache-Control", "Content-Type", "X-Email-Verification-Token"));
configuration.setAllowCredentials(true);
Expand Down

0 comments on commit b6a5b90

Please sign in to comment.