Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Routing for index.html fails with 404 for directories #39871

Closed
yazalulloa opened this issue Apr 3, 2024 · 8 comments · Fixed by #39878
Closed

Routing for index.html fails with 404 for directories #39871

yazalulloa opened this issue Apr 3, 2024 · 8 comments · Fixed by #39878
Labels
Milestone

Comments

@yazalulloa
Copy link

Describe the bug

I have static html inside src/main/resources/META-INF/resources, if I a put a directory inside that path with an index.html it fails with 404 when I make a GET /{directory}

In local and jvm mode it does return the html

Repo: https://github.com/yazalulloa/routing-assets-example

Expected behavior

When a request is done to a path (GET /users) that has a folder with an index.html return the html

Actual behavior

GET /users returns 404

How to Reproduce?

There is a Dockerfile and a bash script to generate the native image and run the container

Make a GET request to /users

Output of uname -a or ver

No response

Output of java -version

Java 21

Mandrel or GraalVM version (if different from Java)

No response

Quarkus version or git rev

3.9.2

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.9.6

Additional information

No response

@yazalulloa yazalulloa added area/native-image kind/bug Something isn't working labels Apr 3, 2024
Copy link

quarkus-bot bot commented Apr 3, 2024

/cc @Karm (mandrel), @galderz (mandrel), @zakkak (mandrel)

@geoand
Copy link
Contributor

geoand commented Apr 4, 2024

I don't consider this a bug, but a feature request and would actually like to know if any other framework behaves as is asked for here.

@geoand geoand added kind/enhancement New feature or request and removed area/native-image kind/bug Something isn't working labels Apr 4, 2024
@zakkak
Copy link
Contributor

zakkak commented Apr 4, 2024

I don't consider this a bug, but a feature request and would actually like to know if any other framework behaves as is asked for here.

@geoand why so? Since it behaves that way in JVM mode shouldn't we consider it a bug if it behaves differently in native?

I also think the area/native-image is valid even if it's not a bug as it concerns native image vs JVM mode.

@geoand
Copy link
Contributor

geoand commented Apr 4, 2024

Ah sorry, I misread the part where it worked in JVM mode - my bad.

@geoand geoand added area/native-image kind/bug Something isn't working and removed kind/enhancement New feature or request labels Apr 4, 2024
@geoand
Copy link
Contributor

geoand commented Apr 4, 2024

I'll check it out

@geoand
Copy link
Contributor

geoand commented Apr 4, 2024

I had something I thought would fix the issue but it doesn't... Given that there is no logging in io.vertx.ext.web.handler.impl.StaticHandlerImpl I am not sure how I can debug what's going on in native...

@zakkak
Copy link
Contributor

zakkak commented Apr 4, 2024

Sounds like you will need to compile with -Dquarkus.native.debug.enabled=true and open the binary with gdb, then set a breakpoint in the methods you are interested in and step through the code. Hopefully there will be enough info to let you understand what's going on. If you need any help let me know.

@geoand
Copy link
Contributor

geoand commented Apr 4, 2024

Thanks!

But in the meantime I realized the error of my ways :).

#39878 is the fix but I still need to add a test

geoand added a commit that referenced this issue Apr 8, 2024
Ensure that index.html works in any directory in native mode
@quarkus-bot quarkus-bot bot added this to the 3.10 - main milestone Apr 8, 2024
@gsmet gsmet modified the milestones: 3.10 - main, 3.9.3 Apr 9, 2024
@gsmet gsmet modified the milestones: 3.9.3, 3.8.5 May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants