Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ private CorsFilter corsFilter() {
CorsConfiguration config = new CorsConfiguration();
config.setAllowCredentials(true);
for(String origin: allowedOrigins.split(",")) {
config.addAllowedOrigin(origin);
if (CorsConfiguration.ALL.equals(origin.trim())) {
// "*" cannot be an allowed origin when credentials are allowed; as a pattern the caller's origin is echoed.
config.addAllowedOriginPattern(CorsConfiguration.ALL);
} else {
config.addAllowedOrigin(origin);
}
}
config.addAllowedHeader(ORIGIN);
config.addAllowedHeader(CONTENT_TYPE);
Expand Down
4 changes: 4 additions & 0 deletions example/src/main/resources/application-test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ mms.admin.password=test

mms.stream.batch.size=100000

# Comma separated list of allowed cross site origins, e.g. https://ve.example.org,https://other.example.org
# Credentials are allowed for every origin listed here. "*" allows any origin: the caller's origin is echoed
# back, so any website may make credentialed cross-origin requests to MMS. That lets a browser client such as
# View Editor work out of the box; listing the explicit origins is the stricter setting, use it in production.
cors.allowed.origins=*

jwt.secret=12345678901234567890123456789012
Expand Down
5 changes: 4 additions & 1 deletion example/src/main/resources/application.properties.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ mms.admin.password=test
mms.stream.batch.size=100000
mms.optimize-for-federated=true

#Comma Separated list of allowed cross site origins
# Comma separated list of allowed cross site origins, e.g. https://ve.example.org,https://other.example.org
# Credentials are allowed for every origin listed here. "*" allows any origin: the caller's origin is echoed
# back, so any website may make credentialed cross-origin requests to MMS. That lets a browser client such as
# View Editor work out of the box; listing the explicit origins is the stricter setting, use it in production.
cors.allowed.origins=*

jwt.secret=make_me_something_really_long
Expand Down
Loading