|
|
|
|
@ -118,7 +118,7 @@ public class HandlerMethodMappingTests {
@@ -118,7 +118,7 @@ public class HandlerMethodMappingTests {
|
|
|
|
|
this.mapping.registerMapping("/fo?", this.handler, this.method2); |
|
|
|
|
|
|
|
|
|
MockServerWebExchange exchange = MockServerWebExchange.from( |
|
|
|
|
MockServerHttpRequest.options("http://example.org/foo") |
|
|
|
|
MockServerHttpRequest.options("https://example.org/foo") |
|
|
|
|
.header(HttpHeaders.ORIGIN, "https://domain.com") |
|
|
|
|
.header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "GET")); |
|
|
|
|
|
|
|
|
|
@ -133,7 +133,7 @@ public class HandlerMethodMappingTests {
@@ -133,7 +133,7 @@ public class HandlerMethodMappingTests {
|
|
|
|
|
this.mapping.registerMapping("/fo?", this.handler, this.handler.getClass().getMethod("corsHandlerMethod")); |
|
|
|
|
|
|
|
|
|
MockServerWebExchange exchange = MockServerWebExchange.from( |
|
|
|
|
MockServerHttpRequest.options("http://example.org/foo") |
|
|
|
|
MockServerHttpRequest.options("https://example.org/foo") |
|
|
|
|
.header(HttpHeaders.ORIGIN, "https://domain.com") |
|
|
|
|
.header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "GET")); |
|
|
|
|
|
|
|
|
|
@ -216,7 +216,7 @@ public class HandlerMethodMappingTests {
@@ -216,7 +216,7 @@ public class HandlerMethodMappingTests {
|
|
|
|
|
CrossOrigin crossOrigin = AnnotatedElementUtils.findMergedAnnotation(method, CrossOrigin.class); |
|
|
|
|
if (crossOrigin != null) { |
|
|
|
|
CorsConfiguration corsConfig = new CorsConfiguration(); |
|
|
|
|
corsConfig.setAllowedOrigins(Collections.singletonList("http://domain.com")); |
|
|
|
|
corsConfig.setAllowedOrigins(Collections.singletonList("https://domain.com")); |
|
|
|
|
return corsConfig; |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
|
|