-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
Environment Details
- OS: MacOS
- Docker version: 20.10.5 Community
- JDK version: 11
- MicroProfile implementation: Helidon MP
- Helidon Version: 2.3.2
Problem Description
Path /openapi-ui redirects to the wrong URI if the MicroProfile app is running inside of Docker container. Extension swaps the host and port to values defined by the container.
I haven't dived deep into the bug, but at least I realized that injected javax.ws.rs.core.UriInfo provides the wrong base URI. As far as I know, Helidon uses Jersey as JAX-RS implementation. So, this problem could be Jersey-specific.
Steps to reproduce
Steps to reproduce:
- Setup Helidon MP (Microprofile implementation) example project.
mvn -U archetype:generate -DinteractiveMode=false \
-DarchetypeGroupId=io.helidon.archetypes \
-DarchetypeArtifactId=helidon-quickstart-mp \
-DarchetypeVersion=2.3.2 \
-DgroupId=io.helidon.examples \
-DartifactId=openapi-ui-issue \
-Dpackage=io.helidon.examples.quickstart.mp;
- Go to pom.xml and add the dependency.
<dependency>
<groupId>org.microprofile-ext.openapi-ext</groupId>
<artifactId>openapi-ui</artifactId>
<version>1.1.4</version>
</dependency>
- Go to the project.
cd openapi-ui-issue;
- Build Docker image.
docker build -t openapi-ui-issue .
- Run Docker container.
docker run --rm -p 9090:8080 openapi-ui-issue:latest
- Open http://127.0.0.1:9090/openapi-ui in the browser.
Browser redirects to the wrong path: http://172.17.0.2:8080/openapi-ui/index.html
Where 172.17.0.2 is the Docker container internal IP and 8080 is the port of the app running inside of the container.
By the way, everything works fine if you specify the full path: http://127.0.0.1:9090/openapi-ui/index.html
Metadata
Metadata
Assignees
Labels
No labels