eclipse-ee4j / eclipse-ee4j/jersey
JettyHttpContainer URL handling broken
- Dominant language
- Java
- Stars
- 730
- Forks
- 382
- PR merge metrics
- No merged PRs in 30d
Description
I'm creating a JAX-RS server using the jetty http container. The resource
is annotated with @Path("/services") and the whole JAX-RS handler is put under context "/my/path" (see code snippet below for details)
So an HTTP GET on /my/path/service should end up in my rest resource. However, it does not on 2.22.2\.
After stepping through the code, it seems that the JettyHttpContainer.handle constructs a wrong requestUri:"http://localhost:52021/my/path/my/path/services"
(notice the duplication of /my/path)
It is related to fixed done in scope of [https://github.com/jersey/jersey/commit/239d02fcc0792155eb5aaf51e5c2b68e61203c19#diff-1997febdf388bca1dd941929123602df](https://github.com/jersey/jersey/commit/239d02fcc0792155eb5aaf51e5c2b68e61203c19#diff-1997febdf388bca1dd941929123602df)
I have reverted back to 2.21.1, which works fine.
```
ContextHandler context = new ContextHandler();
final Handler endpoint = RuntimeDelegate.getInstance().createEndpoint(application, Handler.class);
context.setHandler(endpoint);
context.setContextPath("/my/path");
```
#### Affected Versions
[2.22.2]
Contributor guide
Assessment
This issue has not been assessed yet.