Skip to content

Commit 8a817b6

Browse files
committed
Fix cors
1 parent 3e03be6 commit 8a817b6

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ services:
2121
profiles:
2222
- include-frontend
2323
environment:
24-
BACKEND_URL: http://host.docker.internal:8080
24+
BACKEND_URL: http://localhost:8080
2525
ports:
2626
- "80:80"
2727
course-hub-backend:

src/main/java/net/hackyourfuture/coursehub/SecurityConfig.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
2121
return http.csrf(AbstractHttpConfigurer::disable)
2222
.cors(cors -> cors.configurationSource(request -> {
2323
var config = new CorsConfiguration();
24-
config.addAllowedOriginPattern("http://localhost:8080");
25-
config.addAllowedOriginPattern("http://host.docker.internal:8080");
24+
config.addAllowedOriginPattern("http://localhost");
2625
config.addAllowedOriginPattern("https://coursehub.hyf.dev");
2726
config.addAllowedHeader("*");
2827
config.addAllowedMethod("*");

0 commit comments

Comments
 (0)