- 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

View File

@@ -3,7 +3,8 @@ name: Build, Tag, and Push to GitHub Container Registry
on:
push:
branches:
- disable
- master
- develop
jobs:
build-and-push:

View File

@@ -55,12 +55,11 @@ public class SecurityConfig {
@Bean
public CorsConfigurationSource corsConfigurationSource() {
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.setAllowedHeaders(List.of("Authorization", "Cache-Control", "Content-Type"));
configuration.setExposedHeaders(List.of("Content-Disposition"));
configuration.setAllowCredentials(true);
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", configuration);
return source;