- Enable CORS for all localhost ports

- Enable pipeline
This commit is contained in:
aditya.chandel
2025-03-12 11:15:36 -06:00
parent e11bd81281
commit 4f4c8eb742
2 changed files with 3 additions and 3 deletions
+2 -1
View File
@@ -3,7 +3,8 @@ name: Build, Tag, and Push to GitHub Container Registry
on: on:
push: push:
branches: branches:
- disable - master
- develop
jobs: jobs:
build-and-push: build-and-push:
@@ -55,12 +55,11 @@ public class SecurityConfig {
@Bean @Bean
public CorsConfigurationSource corsConfigurationSource() { public CorsConfigurationSource corsConfigurationSource() {
CorsConfiguration configuration = new CorsConfiguration(); CorsConfiguration configuration = new CorsConfiguration();
configuration.setAllowedOrigins(List.of("http://localhost:4200", "http://localhost:5050")); configuration.setAllowedOrigins(List.of("http://localhost:*"));
configuration.setAllowedMethods(List.of("GET", "POST", "PUT", "DELETE", "OPTIONS")); configuration.setAllowedMethods(List.of("GET", "POST", "PUT", "DELETE", "OPTIONS"));
configuration.setAllowedHeaders(List.of("Authorization", "Cache-Control", "Content-Type")); configuration.setAllowedHeaders(List.of("Authorization", "Cache-Control", "Content-Type"));
configuration.setExposedHeaders(List.of("Content-Disposition")); configuration.setExposedHeaders(List.of("Content-Disposition"));
configuration.setAllowCredentials(true); configuration.setAllowCredentials(true);
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", configuration); source.registerCorsConfiguration("/**", configuration);
return source; return source;