Content-Range in PUT is incorrect

Bug #820161 reported by Jason McCarty
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar WebDAV plugin
Fix Released
Low
Vincent Ladeuil

Bug Description

_put_bytes_ranged sends an incorrect Content-Range header, based on my reading of RFC 2616 and examples. For example, when asked to send the second byte of a file, the function would send

Content-Range: bytes 1-2/*
Content-Length: 1

when it should send

Content-Range: bytes 1-1/*
Content-Length: 1

I don't know if this actually affects any servers, but a server that carefully checked everything would probably choke. Apache doesn't seem to compare content-range to content-length for sanity, it just seeks to the first offset given.

The attached patch corrects the (non-?) issue. I don't really know python, so caveat emptor.

Related branches

Revision history for this message
Jason McCarty (jmccarty) wrote :
Revision history for this message
Vincent Ladeuil (vila) wrote :

Sorry for the delay and thanks for the patch.

Since we never got bug reports for this issue, I suspect all servers cares more about Content-length.

I''ll ignore the len(bytes) == 0 special case as:
1) silently ignoring the request will mask bugs
2) appending nothing means the method shouldn't be called at all so I consider it being the caller responsibility.

Changed in bzr-webdav:
status: New → Confirmed
importance: Undecided → Low
assignee: nobody → Vincent Ladeuil (vila)
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.