Skip to content

Add RFC-compliant headers for 416 Range Not Satisfiable responses #138

Closed

Description

@coderabbitai

Description

The current implementation of the static handler returns 416 Range Not Satisfiable responses without the required RFC 9110 compliant headers.

Problem

When serving invalid ranges, the handler currently returns:

  • A 416 status code
  • Headers that include the full file's Content-Length from _buildBaseHeaders
  • Missing the required Content-Range: bytes */\<size> header

Solution

Per RFC 9110, 416 responses should include:

  1. Content-Range: bytes */\<file-size> header indicating the acceptable range
  2. Content-Length: 0 since no content is being served

Code Location

lib/src/io/static/static_handler.dart line 319-320 in the _serveSingleRange method.

Backlinks

Reported by: @nielsenko

Activity

  1. added
    bug
    on Aug 28, 2025
  2. moved this from Inbox 📫 to Planned 🔭 in Serverpod Frameworkson Aug 28, 2025
  3. moved this from Planned 🔭 to Next Up 🎯 in Serverpod Frameworkson Sep 1, 2025
  4. moved this from Next Up 🎯 to In Progress 🔥 in Serverpod Frameworkson Sep 10, 2025
  5. moved this from In Progress 🔥 to Done 🚀 in Serverpod Frameworkson Sep 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions