mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 15:03:18 +00:00
Correct the default allowed-origins in rest.cfg. Enhance comments in rest.cfg & Application
This commit is contained in:
@@ -126,6 +126,10 @@ public class Application extends SpringBootServletInitializer {
|
|||||||
public WebMvcConfigurer webMvcConfigurer() {
|
public WebMvcConfigurer webMvcConfigurer() {
|
||||||
|
|
||||||
return new WebMvcConfigurer() {
|
return new WebMvcConfigurer() {
|
||||||
|
/**
|
||||||
|
* Create a custom CORS mapping for the DSpace REST API (/api/ paths), based on configured allowed origins.
|
||||||
|
* @param registry CorsRegistry
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void addCorsMappings(@NonNull CorsRegistry registry) {
|
public void addCorsMappings(@NonNull CorsRegistry registry) {
|
||||||
String[] corsAllowedOrigins = configuration.getCorsAllowedOrigins();
|
String[] corsAllowedOrigins = configuration.getCorsAllowedOrigins();
|
||||||
|
@@ -3,10 +3,11 @@
|
|||||||
#---------------------------------------------------------------#
|
#---------------------------------------------------------------#
|
||||||
# These configs are used by the RESTv7 module #
|
# These configs are used by the RESTv7 module #
|
||||||
#---------------------------------------------------------------#
|
#---------------------------------------------------------------#
|
||||||
# Allowed CORS origins. Defaults to * (everywhere)
|
# Allowed CORS origins ("Access-Control-Allow-Origin" header).
|
||||||
# Multiple allowed origin URLs may be comma separated
|
# Defaults to ${dspace.ui.url} if unspecified.
|
||||||
|
# Multiple allowed origin URLs may be comma separated. Wildcard value (*) is *NOT SUPPORTED*.
|
||||||
# (Requires reboot of servlet container, e.g. Tomcat, to reload)
|
# (Requires reboot of servlet container, e.g. Tomcat, to reload)
|
||||||
rest.cors.allowed-origins = *
|
rest.cors.allowed-origins = ${dspace.ui.url}
|
||||||
|
|
||||||
# This property determines the max embeddepth for a FullProjection. This is also used by the SpecificLevelProjection
|
# This property determines the max embeddepth for a FullProjection. This is also used by the SpecificLevelProjection
|
||||||
# as a fallback in case the property is defined on the bean
|
# as a fallback in case the property is defined on the bean
|
||||||
|
Reference in New Issue
Block a user