reta commented on code in PR #2983:
URL: https://github.com/apache/cxf/pull/2983#discussion_r2977675621
##########
rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java:
##########
@@ -246,22 +248,30 @@ public URI resolve(URI uri) {
@Override
public String getMatchedResourceTemplate() {
if (stack != null) {
- final List<URITemplate> templates = new LinkedList<>();
+ String matchedResourceTemplate = getBaseUri().getPath();
+
+ if (HttpUtils.isHttpRequest(message)) {
Review Comment:
@jungm I believe this is not the correct implementation since it captures
the part of the URI which is outside of the JAX-RS scope. The test case from
below is confirming that:
```
Message m = mockMessage("http://localhost:8080/app", "/foo/one/abc");
assertEquals("/app/foo/one/{name:[a-zA-Z][a-zA-Z_0-9]*}",
u.getMatchedResourceTemplate());
```
I believe the `/app` should not be included in the resource template (it is
managed externally, could be set by servlet container / application server /
...), it is reasonable to assume the correct template in this case should be
`/foo/one/{name:[a-zA-Z][a-zA-Z_0-9]*}`.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]