Updated CORS configuration to handle empty allowed origins and added placeholder property.
This commit is contained in:
parent
c02a716ecc
commit
e1791942cb
2 changed files with 7 additions and 3 deletions
|
|
@ -2,8 +2,8 @@ package de.avatic.lcc.config;
|
|||
|
||||
import de.avatic.lcc.model.db.users.User;
|
||||
import de.avatic.lcc.repositories.users.GroupRepository;
|
||||
import de.avatic.lcc.service.apps.JwtTokenService;
|
||||
import de.avatic.lcc.repositories.users.UserRepository;
|
||||
import de.avatic.lcc.service.apps.JwtTokenService;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
|
@ -128,7 +128,9 @@ public class SecurityConfig {
|
|||
origins[i] = origins[i].trim();
|
||||
}
|
||||
|
||||
if (origins.length != 0) {
|
||||
configuration.setAllowedOrigins(Arrays.asList(origins));
|
||||
}
|
||||
configuration.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE", "OPTIONS"));
|
||||
configuration.setAllowedHeaders(List.of("*"));
|
||||
configuration.setAllowCredentials(true);
|
||||
|
|
|
|||
|
|
@ -21,3 +21,5 @@ spring.flyway.enabled=true
|
|||
spring.flyway.locations=classpath:db/migration
|
||||
spring.flyway.baseline-on-migrate=true
|
||||
spring.sql.init.mode=never
|
||||
|
||||
lcc.allowed_cors=
|
||||
Loading…
Add table
Reference in a new issue