Merge pull request #223 from hapifhir/pw/fixing-cors_again

FIXING CORS: changed CORS to allowed origin pattern
This commit is contained in:
James Agnew
2021-04-01 14:49:46 -04:00
committed by GitHub
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("X-Requested-With");
config.addAllowedHeader("Prefer"); config.addAllowedHeader("Prefer");
List<String> allAllowedCORSOrigins = appProperties.getCors().getAllowed_origin(); List<String> allAllowedCORSOrigins = appProperties.getCors().getAllowed_origin();
allAllowedCORSOrigins.forEach(config::addAllowedOrigin); allAllowedCORSOrigins.forEach(config::addAllowedOriginPattern);
config.addExposedHeader("Location"); config.addExposedHeader("Location");

View File

@@ -82,12 +82,11 @@ hapi:
#partitioning: #partitioning:
# allow_references_across_partitions: false # allow_references_across_partitions: false
# partitioning_include_in_search_hashes: false # partitioning_include_in_search_hashes: false
#cors: cors:
# allow_Credentials: true allow_Credentials: true
# Supports multiple, comma separated allowed origin entries # 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-
# cors.allowed_origin=http://localhost:8080,https://localhost:8080,https://fhirtest.uhn.ca allowed_origin:
# allowed_origin: - '*'
# - '*'
# logger: # logger:
# error_format: 'ERROR - ${requestVerb} ${requestUrl}' # error_format: 'ERROR - ${requestVerb} ${requestUrl}'