bzr ERROR: Invalid http response

Robert Collins robertc at robertcollins.net
Sun Feb 10 22:25:37 GMT 2008


On Mon, 2008-02-11 at 07:18 +1100, Erik de Castro Lopo wrote:
> Vincent Ladeuil wrote:
> 
> > See https://bugs.edge.launchpad.net/bzr/+bug/190501.
> > 
> > This should indeed be easy to fix in boa.
> 
> I'm looking at RFC 2616:
> 
>     http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.5
> 
> and I don't see anything stating "204 is not intended to be used for
> zero size files but for empty bodies".

It might help to think in database terms:
204 is for NULL bodies
200 for zero length bodies

But really, arguing about what its for in the sense of GET requests is
pointless.... exposition in rfc2616 section 9.5 (POST), and 9.6(PUT),
and 9.7 (DELETE) makes it clear that to me that 204 is for the use in
reply to mutating requests. For example if you are on a web page like
https://launchpad.net/bzr/+bugs/12345, a POST there to update the bug
can return 204 when it wants the browser to:
 - keep you at the same url
 - keep the same displayed content (and if no other updates occured
concurrently, why not)

Idempotent requests have no reason to return 204, and - see 9.1.1. And
9.3 (GET) is defined as returning the entity - and 204 has only
entity-header fields, no entity-body and is thus not a complete entity -
it is never a valid response to GET. I can see nothing making it illegal
to return a 204 on a HEAD request.

From section 10.2.5: ""The server has fulfilled the request but does not
need to return an entity-body, and might want to return updated
metainformation."

Note the "does not need" here GET requires a body. Now, to argue that a
missing file might be appropriate for 204 rather than 404, note that
there are no entity-headers for a missing resource. (no content-type,
etc). So 204 is not valid for a missing resource either.

Definately a bug in boa.

-Rob

 status invalid


-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080211/9c0ff731/attachment.pgp 


More information about the bazaar mailing list