You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The current support for serving static files is limited or lacks flexibility in handling various use cases, such as caching, content negotiation, or serving files from custom directories. Enhancing this functionality can improve performance and make the framework more versatile.
Describe the solution you'd like
Enhance static file support by:
Allowing configuration for serving files from custom directories.
Supporting partial content responses (e.g., Range requests) for large files.
Improving MIME type handling for different file extensions.
Describe alternatives you've considered
Using an external file server to handle static files. While feasible, this introduces additional complexity and dependencies for applications that need to serve static assets.
Additional context
Enhanced static file support will align the framework with modern web application needs and simplify serving common assets like images, scripts, and styles.
Activity
[-]RELIC: Enhance Support for Serving Static Files[/-][+]Enhance Support for Serving Static Files[/+]nielsenko commentedon Aug 6, 2025
The current static file support (inherited from shelf) stems from another time. Going forward the driving principle will be:
Only serve files that are explicitly allowed, and only on exact path matches.
This means:
What to serve:
.html,.css,.js,.png, etc.)What NOT to serve:
.env,.config,.log, etc.)../traversal.)Implementation approach:
Assuming /public is the root of the directory for files served statically .
Key principles:
This approach minimizes attack surface and prevents accidental exposure of sensitive files.
nielsenko commentedon Aug 6, 2025
Also, we will forego weak eTags and only support strong eTags. The complexity of weak eTags is just not worth the trouble.