changed CORS to allowed origin pattern

This commit is contained in:
patrick-werner
2021-03-31 12:34:28 +02:00
parent 390dad7974
commit 583c542c92
2 changed files with 6 additions and 7 deletions

View File

@@ -280,7 +280,7 @@ public class BaseJpaRestfulServer extends RestfulServer {
config.addAllowedHeader("X-Requested-With");
config.addAllowedHeader("Prefer");
List<String> allAllowedCORSOrigins = appProperties.getCors().getAllowed_origin();
allAllowedCORSOrigins.forEach(config::addAllowedOrigin);
allAllowedCORSOrigins.forEach(config::addAllowedOriginPattern);
config.addExposedHeader("Location");

View File

@@ -82,12 +82,11 @@ hapi:
#partitioning:
# allow_references_across_partitions: false
# partitioning_include_in_search_hashes: false
#cors:
# allow_Credentials: true
# Supports multiple, comma separated allowed origin entries
# cors.allowed_origin=http://localhost:8080,https://localhost:8080,https://fhirtest.uhn.ca
# allowed_origin:
# - '*'
cors:
allow_Credentials: true
# These are allowed_origin patterns, see: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/cors/CorsConfiguration.html#setAllowedOriginPatterns-java.util.List-
allowed_origin:
- '*'
# logger:
# error_format: 'ERROR - ${requestVerb} ${requestUrl}'