Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

send 416 error to overlapping ranges request #782

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Chenjp
Copy link
Contributor

@Chenjp Chenjp commented Nov 19, 2024

request ranges validation - overlap detection added.

  • invalid ranges - overlapping:
D:\git\github.com>curl http://localhost:55464/index.html -i -H "Range: bytes=10-40,35-50"
HTTP/1.1 416
Accept-Ranges: bytes
Content-Range: bytes */957
Content-Type: text/html;charset=utf-8
Content-Language: zh-CN
Content-Length: 753
Date: Tue, 19 Nov 2024 03:03:56 GMT
  • valid ranges:
D:\git\github.com>curl http://localhost:55464/index.html -i -H "Range: bytes=10-40,50-60"
HTTP/1.1 206
Accept-Ranges: bytes
ETag: W/"957-1724403887512"
Last-Modified: Fri, 23 Aug 2024 09:04:47 GMT
Content-Type: multipart/byteranges; boundary=CATALINA_MIME_BOUNDARY
Content-Length: 194
Date: Tue, 19 Nov 2024 03:04:39 GMT


--CATALINA_MIME_BOUNDARY
Content-Range: bytes 10-40/957

censed to the Apache Software F
--CATALINA_MIME_BOUNDARY
Content-Range: bytes 50-60/957

 (ASF) unde
--CATALINA_MIME_BOUNDARY--

add overlapping ranges validation.
@gmshake
Copy link

gmshake commented Nov 19, 2024

Nice catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants