/claim #709
This PR implements comprehensive HTTP Range header support (RFC 7233) natively integrated into ZIO-HTTP’s file serving methods. Range requests enable efficient partial content delivery for video streaming, download resumption, and bandwidth optimization.
Key Features:
- Native integration - Handler.fromFile and Middleware.serveDirectory automatically support Range requests
- Full RFC 7233 compliance - Single ranges, multiple ranges, suffix ranges, and open-ended ranges
- Intelligent range merging - Overlapping ranges are automatically merged for optimal responses
- Multipart support - Multiple non-overlapping ranges return proper multipart/byteranges responses
- Proper status codes - 206 Partial Content, 416 Range Not Satisfiable with correct headers
- Backward compatible - Existing code works unchanged, Range support is transparent
Addresses the original issue by replacing hardcoded DefaultFileRegion(raf.getChannel, 0, fileLength) with dynamic range handling that respects Range headers. Includes comprehensive test coverage (11 tests) and working example server.