Skip to content

Commit 9010b7b

Browse files
committed
FIX / 에러 수정
1 parent 258e66a commit 9010b7b

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/main/java/com/balybus/galaxy/global/config/SecurityConfig.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
3939
.requestMatchers("/api/sign-up", "/api/sign/up/helper", "/api/sign/in", "http://3.37.158.7:8080/", "http://3.37.158.7:8080", "http://localhost:8080/").permitAll()
4040
// .requestMatchers("/api/**").permitAll()
4141
.requestMatchers("/api/sign/**").permitAll()
42-
.requestMatchers("/").permitAll()
42+
.requestMatchers("/api").permitAll()
4343
.requestMatchers("/api/token/**").permitAll()
4444
.requestMatchers("/swagger-resources/**", "/swagger-ui/**", "/v3/api-docs/**").permitAll()
4545
.requestMatchers("/img/**", "/css/**", "/static/js/**", "/docs/**").permitAll()
@@ -59,8 +59,11 @@ public BCryptPasswordEncoder passwordEncoder() {
5959
public CorsConfigurationSource corsConfigurationSource() {
6060
final CorsConfiguration config = new CorsConfiguration();
6161

62-
config.setAllowedOriginPatterns(Arrays.asList("*"));
63-
config.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE", "OPTIONS"));
62+
config.setAllowedOrigins(Arrays.asList(
63+
"http://3.37.158.7",
64+
"http://3.37.158.7:80",
65+
"http://localhost:5173"
66+
)); config.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE", "OPTIONS"));
6467
config.setAllowedHeaders(Arrays.asList("Authorization", "Cache-Control", "Content-Type"));
6568
config.setExposedHeaders(Arrays.asList("*"));
6669
config.setAllowCredentials(true);

src/main/resources/application.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,7 @@ springdoc:
1212

1313
cors:
1414
allowed:
15-
origins: http://13.124.151.164:8080, http://13.124.151.164:80, http://13.124.151.164:5173
15+
origins: http://3.37.158.7:8080, http://3.37.158.7:80, http://3.37.158.7:5173
16+
server:
17+
servlet:
18+
context-path: /api

0 commit comments

Comments
 (0)