Adds notes about future CORS support
see gh-229
This commit is contained in:
@@ -18,10 +18,10 @@
|
||||
package org.springframework.cloud.gateway.handler;
|
||||
|
||||
import java.util.function.Function;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.springframework.cloud.gateway.route.Route;
|
||||
import org.springframework.cloud.gateway.route.RouteLocator;
|
||||
import org.springframework.web.cors.CorsConfiguration;
|
||||
import org.springframework.web.reactive.handler.AbstractHandlerMapping;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
|
||||
@@ -65,6 +65,15 @@ public class RoutePredicateHandlerMapping extends AbstractHandlerMapping {
|
||||
})));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CorsConfiguration getCorsConfiguration(Object handler, ServerWebExchange exchange) {
|
||||
//TODO: support cors configuration via global properties and
|
||||
// properties on a route see gh-229
|
||||
// see RequestMappingHandlerMapping.initCorsConfiguration()
|
||||
// also see https://github.com/spring-projects/spring-framework/blob/master/spring-web/src/test/java/org/springframework/web/cors/reactive/CorsWebFilterTests.java
|
||||
return super.getCorsConfiguration(handler, exchange);
|
||||
}
|
||||
|
||||
//TODO: get desc from factory?
|
||||
private String getExchangeDesc(ServerWebExchange exchange) {
|
||||
StringBuilder out = new StringBuilder();
|
||||
|
||||
Reference in New Issue
Block a user