Skip to content

[CXF-9209] UriInfoImpl#getMatchedResourceTemplate support variable Paths#2983

Open
jungm wants to merge 1 commit intoapache:mainfrom
jungm:issue/CXF-9209
Open

[CXF-9209] UriInfoImpl#getMatchedResourceTemplate support variable Paths#2983
jungm wants to merge 1 commit intoapache:mainfrom
jungm:issue/CXF-9209

Conversation

@jungm
Copy link
Member

@jungm jungm commented Mar 22, 2026

See CXF-9209

TCK run is passing in TomEE with these changes

final List<URITemplate> templates = new LinkedList<>();
String matchedResourceTemplate = getBaseUri().getPath();

if (HttpUtils.isHttpRequest(message)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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]*}.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants