Skip to content

Conversation

qnnn
Copy link
Contributor

@qnnn qnnn commented Oct 3, 2024

I noticed in the ReadBodyRoutePredicateFactory that it states "we do not try to read the request body multiple times." This seems to impact the logic of route matching. The reproducible route definitions are as follows(or see unit test):

.route(
        r -> r.order(-2).readBody(String.class, string -> false)
                .uri("http://127.0.0.1:8081"))
.route(
        // At this point, even if the body content can be converted to a map,
        // this assertion will not be hit.
        r -> r.order(-1).readBody(Map.class, map -> true)
                .uri("http://127.0.0.1:8081"))

If one route is not matched, it should not affect the matching of other routes. Additionally, we have placed the mutable request in the CACHED_SERVER_HTTP_REQUEST_DECORATOR_ATTR attribute, and we can continue to use it to address this.

@qnnn
Copy link
Contributor Author

qnnn commented Oct 3, 2024

A corresponding implementation has also been made in Gateway MVC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants