reta commented on a change in pull request #703:
URL: https://github.com/apache/cxf/pull/703#discussion_r499307465
##########
File path:
systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookServer20.java
##########
@@ -227,7 +227,7 @@ public void filter(ContainerRequestContext context) throws
IOException {
} else if (path.endsWith("books/check2")) {
replaceStream(context);
} else if (path.endsWith("books/checkNQuery")) {
- URI requestURI = URI.create(path.replace("NQuery", "2?a=b"));
+ URI requestURI = URI.create(path.replace("NQuery", "2"));
Review comment:
> Hmm... maybe I don't fully understand. I think the test was broken
from the start since it was effectively setting the RequestUri to
`/bookstore/books/check2?a=b?a=b` - the previous behavior (prior to #697) was
to simply ignore the query string entirely which was why the test passed even
though the URI was invalid. After #697 the test failed because we were actually
checking the query string.
I think the test case was fine, let me try to illustrate what was happening
before the change and after, for simplicity I will just include the URI into
method arguments.
So before:
```
containerRequestContext.setRequestUri("/bookstore/books/check2?a=b")
m.get(Message.REQUEST_URI) -> /bookstore/books/check2
m.get(Message.QUERY_STRING) -> a=b
```
After the change:
```
containerRequestContext.setRequestUri("/bookstore/books/check2?a=b")
m.get(Message.REQUEST_URI) -> /bookstore/books/check2?a=b
m.get(Message.QUERY_STRING) -> a=b
```
As you can see, `Message.REQUEST_URI` has raw path before, but now - full
URI. And that causing the issues. Unfortunately I don't know all the places but
it seems like raw URI is being used to find the matching methods to invoke fe.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]