Skip to content

416 Range Not Satisfiable if requested range end > file size #1588

Closed
@jkmnt

Description

Long story short

static content:
aiohttp responses with 416 Range Not Satisfiable if requested range end > file size

Expected behaviour

range end is trimmed to the file end as per RFC7233 and 206 Partial Content is returned:
" ... If the last-byte-pos value is absent, or if the value is greater than or equal to the current
length of the representation data, the byte range is interpreted as the remainder of the
representation (i.e., the server replaces the value of last-byte-pos with a value that is one
less than the current length of the selected representation)."

Actual behaviour

416 Range Not Satisfiable returned

Steps to reproduce

Serve small static file (say, 1000 bytes), issue range request with the field 'Range: bytes=0-32767', observe 416 response

Your environment

aiohttp 1.2.0

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions