Jetty version(s)
12.1.6, but fails as far back as 12.1.4
Jetty Environment
jetty-12 only
HTTP version
Tested on http2
Java version/vendor (use: java -version)
Java 21 and 25
OS type/version
OSX: Darwin Kernel Version 25.2.0 on Apple Silicon
Description
When using the Resource Handler to serve up static assets and setUseFileMapping is true, requests with a byte range not starting at 0, e.g., range: "bytes=15032-49184", the server attempts to send the bytes starting from 0 resulting in a java.io.IOException: written 49185 > 34153 content-length
Requesting a byte range starting at 0, works as expected.
Setting setUseFileMapping to false resolves the issue.
How to reproduce?
Use a ResourceHandler to server up static assets and setUseFileMapping to true. Then request a byte range not starting at 0.