eclipse-ee4j / eclipse-ee4j/jersey
netty container disregards path component of baseUri
- Dominant language
- Java
- Stars
- 730
- Forks
- 382
- PR merge metrics
- No merged PRs in 30d
Description
No matter, which path component is specified in the baseUri when creating the server via org.glassfish.jersey.netty.httpserver.NettyHttpContainerProvider#createHttp2Server (probably the same for `createServer`?), all the resources are located relative to "/".
e.g. use a `@Path("example")` resource together with `createHttp2Server(URI.create("http://localhost:13333/abc/"), rc, ...)`
The client sees the resource wrongly located at "http://localhost:13333/example".
Using the debugger, I found the problem to be in org.glassfish.jersey.netty.httpserver.JerseyHttp2ServerHandler#createContainerRequest . The issue is, that it creates the `requestUri` from the baseUri + the path from the HTTP header, so it believes, the HTTP request was for "http://localhost:13333/abc/example".
Note: Please compare this with `GrizzlyHttpServerFactory.createHttpServer(URI.create("http://localhost:13333/abc/", rc, ...)`, which behaves correctly. (There, the client sees the resource at "http://localhost:13333/abc/example")
Versions:
- jersey-container-netty-http version 2.28
- jersey-container-grizzly2-http 2.28
Contributor guide
Assessment
This issue has not been assessed yet.