Javalin doesn't send content length for static files
See original GitHub issueActual behavior (the bug) Javalin sends the following headers for static files:
HTTP/1.1 200 OK
Date: Sat, 07 Mar 2020 00:49:12 GMT
Server: Javalin
Cache-Control: max-age=0
Last-Modified: Thu, 05 Mar 2020 18:41:48 GMT
ETag: W/"IrppwYhEcFYIrposSZrYkI"
Accept-Ranges: bytes
Transfer-Encoding: chunked
FILE HERE
Expected behavior Should send a content length header as well
To Reproduce Create a Javalin server and serve a static file from it.
Additional context Breaks file downloads on everything but Chrome.
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (8 by maintainers)
Top Results From Across the Web
Javalin doesn't send content length for static files #892 - GitHub
Expected behavior. Should send a content length header as well. To Reproduce Create a Javalin server and serve a static file from it....
Read more >Documentation - A lightweight Java and Kotlin web framework
Common methods are supported directly on the Javalin class (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS), uncommon operations (TRACE, CONNECT) are supported ...
Read more >javalin-io/general - Gitter
Hello, I am trying to deploy a Javalin application to Heroku. ... load balancer that is sitting in front of the Java process...
Read more >Jersey response: don't set Content-Length header if Transfer ...
@GET @Path("/path") public static Response get( @Context UriInfo uriinfo, @Context HttpHeaders httpHeaders, byte[] body ) throws Exception{ // ...
Read more >Using OpenAPI and Swagger UI - Quarkus
The static file to serve must be a valid document conforming to the OpenAPI ... OK - fruits list content: application/json: {} post:...
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
Seems Jetty will use chunked if http version is 1.1 or outputBufferSize is not enough to put all content in. https://github.com/eclipse/jetty.project/blob/a304fd9f351f337e7c0e2a7c28878dd536149c6c/jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java#L611 https://github.com/eclipse/jetty.project/blob/a304fd9f351f337e7c0e2a7c28878dd536149c6c/jetty-http/src/main/java/org/eclipse/jetty/http/HttpGenerator.java#L342
If httpConfig.outputBufferSize is larger than static file then it will send
content-length
For large file it will allocate too much memory. When I set
outputBufferSize = Int.MAX_VALUE
This has been fixed now!