diff --git a/spring-cloud-gateway-server-mvc/src/main/java/org/springframework/cloud/gateway/server/mvc/handler/GatewayRouterFunctionsBuilder.java b/spring-cloud-gateway-server-mvc/src/main/java/org/springframework/cloud/gateway/server/mvc/handler/GatewayRouterFunctionsBuilder.java index 2e81fc573e..527e9fc2da 100644 --- a/spring-cloud-gateway-server-mvc/src/main/java/org/springframework/cloud/gateway/server/mvc/handler/GatewayRouterFunctionsBuilder.java +++ b/spring-cloud-gateway-server-mvc/src/main/java/org/springframework/cloud/gateway/server/mvc/handler/GatewayRouterFunctionsBuilder.java @@ -18,6 +18,7 @@ import java.util.Map; import java.util.Optional; +import java.util.function.BiConsumer; import java.util.function.BiFunction; import java.util.function.Consumer; import java.util.function.Function; @@ -26,6 +27,7 @@ import org.springframework.cloud.gateway.server.mvc.common.MvcUtils; import org.springframework.core.io.Resource; +import org.springframework.http.HttpHeaders; import org.springframework.web.servlet.function.HandlerFilterFunction; import org.springframework.web.servlet.function.HandlerFunction; import org.springframework.web.servlet.function.RequestPredicate; @@ -253,6 +255,18 @@ public RouterFunctions.Builder resources(Function headersConsumer) { + builder.resources(pattern, location, headersConsumer); + return this; + } + + @Override + public RouterFunctions.Builder resources(Function> lookupFunction, BiConsumer headersConsumer) { + builder.resources(lookupFunction, headersConsumer); + return this; + } + @Override public RouterFunctions.Builder nest(RequestPredicate predicate, Supplier> routerFunctionSupplier) {