Skip to content

Commit

Permalink
Merge pull request hapifhir#223 from hapifhir/pw/fixing-cors_again
Browse files Browse the repository at this point in the history
FIXING CORS: changed CORS to allowed origin pattern
  • Loading branch information
jamesagnew authored Apr 1, 2021
2 parents 390dad7 + 583c542 commit b5eb3be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ protected void initialize() throws ServletException {
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");
Expand Down
11 changes: 5 additions & 6 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}'
Expand Down

0 comments on commit b5eb3be

Please sign in to comment.