- Timestamp:
- 03/04/24 17:14:11 (15 months ago)
- Branches:
- main
- Children:
- 5a9c93b
- Parents:
- 24819a8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/rezevirajmasa/demo/config/SecurityConfig.java
r24819a8 ra2c6c2b 12 12 import org.springframework.security.web.SecurityFilterChain; 13 13 import org.springframework.security.web.util.matcher.AntPathRequestMatcher; 14 import org.springframework.web.cors.CorsConfiguration; 15 import org.springframework.web.cors.UrlBasedCorsConfigurationSource; 16 import org.springframework.web.filter.CorsFilter; 14 17 import org.springframework.web.servlet.config.annotation.CorsRegistry; 15 18 import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; … … 33 36 public void addCorsMappings(CorsRegistry registry) { 34 37 registry.addMapping("/**") 38 .allowCredentials(true) 35 39 .allowedOrigins("http://localhost:3000") // Allow requests from this origin 36 40 .allowedMethods("GET", "POST", "PUT", "DELETE") // Allow these HTTP methods 37 .allowedHeaders("*"); // Allow all headers 41 .allowedHeaders("*") 42 .maxAge(3600L); // Allow all headers 38 43 } 39 44
Note:
See TracChangeset
for help on using the changeset viewer.