Ticket #3814 defect closed fixed

Opened 5 years ago

Last modified 5 years ago

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

Reported by: mwh Owned by: mwh
Priority: normal Milestone:
Component: web Keywords:
Cc: Branch:
Author: Launchpad Bug:

Description

/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
Trying 127.0.0.1...
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

01234567890123456789
^]

telnet> close

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

Change History

1

Changed 5 years ago by mwh

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

refs #3814

2

Changed 5 years ago by mwh

  • status changed from new to closed
  • resolution set to fixed

(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.