Skip to content

Jetty 12.1.6 ResourceHandler not respecting start of byte range request when setUseFileMapping is true #14536

@sandhu

Description

@sandhu

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugFor general bugs on Jetty side

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions