question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Static files handler doesn't route /path/ to /path/index.html

See original GitHub issue

Actual behavior (the bug) Static files config gets a 404 Not Found for the root path / and other paths ending in / (e.g. /course/), when an index.html exists in the corresponding resource folder.

Video showing behavior change when i switch to my v5 branch: https://www.loom.com/share/bb60c18b18004333a2b5c7402e960a96

Branch being used in the video: https://github.com/A1Liu/schedge/pull/141

Expected behavior I think I expected the static files config to behave the same as in v4, and respond with the resource at /next/index.html when the user goes to http://localhost:4358/

To Reproduce I made another branch with much less code that still reproduces the error, without needing to do anything too fancy: https://github.com/A1Liu/schedge/pull/149

It’s a Gradle project, so it should be build-able using Gradle, and it runs on port 4358 . After building, you can run the fat-jar directly using

java -Xmx1G -Djdk.httpclient.allowRestrictedHeaders=host,connection \
  -jar ./build/libs/schedge.jar serve

Additional context

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
tipsycommented, Oct 17, 2022

This has been released as part of 5.1.1

1reaction
zugazagoitiacommented, Oct 17, 2022

Update: Definitely a bug (at the very least an inconsistency) on our side, when setting staticFiles.precompress = false; javalin serves the index.html file, I have a fix and will PR later.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring Boot not serving static content - Stack Overflow
html will be served when the request URL is /index.html . The class that is responsible for resolving the path, as of Spring...
Read more >
Inability to use '/' for static files · Issue #75 · gin-gonic/gin · GitHub
Hi, I'm very sad to find out that gin doesn't allow you to have '/' as your top level route for static files....
Read more >
middleware.Rmd - Amazon AWS
This file contains a general toolkit for routing and combining bits of HTTP-handling logic. It is similar in spirit to Rook (and Rack,...
Read more >
django.urls functions for use in URLconfs
path () ¶ ... Returns an element for inclusion in urlpatterns . For example: from django.urls import include, path urlpatterns = [ path('index/',...
Read more >
serverless-aws-static-file-handler - npm
Start using serverless-aws-static-file-handler in your project by running ... context) => { event.path = "index.html" // forcing a specific ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found