Adding headers (e.g. content-disposition) for static resources?
See original GitHub issueWhen using static resources documented here: https://www.http4k.org/guide/modules/core/
routes(
"/static" bind static(Classpath("/org/http4k/some/package/name")),
"/hotreload" bind static(Directory("path/to/static/dir/goes/here"))
)
Is it possible to somehow define content-type, content-disposition? I tried to add the header manually, but it doesn’t seem trivial.
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (8 by maintainers)
Top Results From Across the Web
How to set content-disposition to inline for static file(s) in java ...
I know how to set content-disposition header for dynamic requests, but how to set it for static files. Problem is that GAE java...
Read more >HTTP headers | Content-Disposition - GeeksforGeeks
This response header field holds a number of values and parameters in the larger context of MIME (Multipurpose Internet Mail Extensions).
Read more >Content-Disposition - HTTP - MDN Web Docs
In a regular HTTP response, the Content-Disposition response header is a header indicating if the content is expected to be displayed inline ...
Read more >Content-Disposition HTTP Header: Syntax, Directive, Examples
The Content-Disposition HTTP Header response header is a header that indicates whether the content will be displayed inline in the browser.
Read more >ContentDisposition.Parameters Property (System.Net.Mime)
Examples. The following code example displays the parameters that are sent to the Content-Disposition header.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Also this might be helpful for adding caching headers for static resources.
We already have a mapping file of extension to content type in mime.types