Ticket #301 (new defect)
Ranger header missing "bytes"
| Reported by: | makuk66 | Owned by: | ianb |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.4.2 |
| Component: | paste | Version: | svn-trunk |
| Severity: | normal | Keywords: | |
| Cc: |
Description
I use Pylons with Paste 1.4.2. When requesting a URL to a file in the public/ directory, Paste responds with:
200 OK Connection: close Accept-Ranges: bytes Content-Range: 0-7218/7219
The Ranger header should have the word "bytes" and a space before the byte range spec according to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.16
A user reported that this can cause problems with the Polipo proxy.
One quick fix is to change httpheaders.py:
retval = "%d-%d/%d" % (first_byte, last_byte, total_length)
to:
retval = "bytes %d-%d/%d" % (first_byte, last_byte, total_length)
which duly produces "bytes":
Content-Range: bytes 0-7218/7219
but I have not verified if that has any non-intended side-effects.
