Opened 9 years ago

Closed 9 years ago

#3814 defect closed fixed (fixed)

t.w.static.File lies in content-length when byterange falls off the end of the file

Reported by: Michael Hudson-Doyle Owned by: Michael Hudson-Doyle
Priority: normal Milestone:
Component: web Keywords:
Cc: Branch:


/foo is a 30 byte static resource. That makes it hard to serve 990 bytes out of it, which is what twisted.web claims it's going to do:

mwh@grond:Twisted$ telnet localhost 8081
Connected to localhost.
Escape character is '^]'.
GET /foo HTTP/1.1
Host: localhost
Range: bytes=10-1000
Connection: close
HTTP/1.1 206 Partial Content
Content-Length: 990
Accept-Ranges: bytes
Content-Range: bytes 10-999/31
Server: TwistedWeb/8.2.0+r26805
Last-Modified: Mon, 04 May 2009 08:40:47 GMT
Connection: close
Date: Mon, 04 May 2009 08:42:26 GMT
Content-Type: text/html


telnet> close

I guess I'll fix this at the same time as I fix #3574.

Change History (2)

comment:1 Changed 9 years ago by Michael Hudson-Doyle

(In [26906]) test and fix for when the range falls off the end of the resource.

refs #3814

comment:2 Changed 9 years ago by Michael Hudson-Doyle

Resolution: fixed
Status: newclosed

(In [27029]) Merge t.w.static.File-multiple-ranges-3574-2

Author: mwhudson Reviewer: therve Fixes: #3574 Fixes: #3814

Support multiple byteranges in the Range: header in requests for static resources.

In the process fix a bug with Content-Length being wrong when the request range only partially overlaps with the resource.

Note: See TracTickets for help on using tickets.