Skip to content

Commit 4b83e7c

Browse files
committed
Relocate CORS related to grace-plugin-url-mappings
Remove method `setGrailsCorsConfiguration()` in `UrlMappingsHandlerMapping`, use `AbstractHandlerMapping.setCorsConfigurations()` instead
1 parent 5f7f4df commit 4b83e7c

File tree

5 files changed

+6
-11
lines changed

5 files changed

+6
-11
lines changed

grace-web-url-mappings/src/main/groovy/grails/web/mapping/cors/GrailsCorsConfiguration.groovy renamed to grace-plugin-url-mappings/src/main/groovy/grails/web/mapping/cors/GrailsCorsConfiguration.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2022 the original author or authors.
2+
* Copyright 2014-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

grace-web-url-mappings/src/main/groovy/grails/web/mapping/cors/GrailsCorsFilter.groovy renamed to grace-plugin-url-mappings/src/main/groovy/grails/web/mapping/cors/GrailsCorsFilter.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2022 the original author or authors.
2+
* Copyright 2014-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

grace-web-url-mappings/src/main/groovy/grails/web/mapping/cors/GrailsDefaultCorsConfiguration.groovy renamed to grace-plugin-url-mappings/src/main/groovy/grails/web/mapping/cors/GrailsDefaultCorsConfiguration.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2022 the original author or authors.
2+
* Copyright 2014-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

grace-plugin-url-mappings/src/main/groovy/org/grails/plugins/web/mapping/UrlMappingsPluginConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2021-2024 the original author or authors.
2+
* Copyright 2021-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -87,7 +87,7 @@ public UrlMappingsHandlerMapping urlMappingsHandlerMapping(ObjectProvider<Grails
8787
UrlMappingsHandlerMapping handlerMapping = new UrlMappingsHandlerMapping(urlMappingsHolderProvider.getIfAvailable());
8888

8989
if (!corsFilterEnabled) {
90-
handlerMapping.setGrailsCorsConfiguration(grailsCorsConfiguration);
90+
handlerMapping.setCorsConfigurations(grailsCorsConfiguration.getCorsConfigurations());
9191
}
9292

9393
return handlerMapping;

grace-web-url-mappings/src/main/groovy/org/grails/web/mapping/mvc/UrlMappingsHandlerMapping.groovy

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2024 the original author or authors.
2+
* Copyright 2014-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -34,7 +34,6 @@ import grails.web.http.HttpHeaders
3434
import grails.web.mapping.UrlMapping
3535
import grails.web.mapping.UrlMappingInfo
3636
import grails.web.mapping.UrlMappingsHolder
37-
import grails.web.mapping.cors.GrailsCorsConfiguration
3837
import grails.web.mime.MimeType
3938
import grails.web.mime.MimeTypeResolver
4039

@@ -213,8 +212,4 @@ class UrlMappingsHandlerMapping extends AbstractHandlerMapping {
213212

214213
}
215214

216-
void setGrailsCorsConfiguration(GrailsCorsConfiguration grailsCorsConfiguration) {
217-
this.corsConfigurations = grailsCorsConfiguration.corsConfigurations
218-
}
219-
220215
}

0 commit comments

Comments
 (0)