Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes gh-2933 GatewayFilter support @Order annotation #2934

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.springframework.cloud.gateway.filter.OrderedGatewayFilter;
import org.springframework.cloud.gateway.filter.factory.GatewayFilterFactory;
import org.springframework.cloud.gateway.route.Route;
import org.springframework.core.DecoratingProxy;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.AnnotationAwareOrderComparator;
import org.springframework.web.server.ServerWebExchange;
Expand All @@ -43,6 +44,7 @@
*
* @author Rossen Stoyanchev
* @author Spencer Gibb
* @author Yuxin Wang
* @since 0.1
*/
public class FilteringWebHandler implements WebHandler {
Expand Down Expand Up @@ -124,7 +126,7 @@ public Mono<Void> filter(ServerWebExchange exchange) {

}

private static class GatewayFilterAdapter implements GatewayFilter {
private static class GatewayFilterAdapter implements GatewayFilter, DecoratingProxy {

private final GlobalFilter delegate;

Expand All @@ -145,6 +147,11 @@ public String toString() {
return sb.toString();
}

@Override
public Class<?> getDecoratedClass() {
return delegate.getClass();
}

}

}