Re: CONTENT_LENGTH can no longer be empty
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Sep 6, 2018, 06:10 UTC
- Message-ID
- <20180906061038.GA94045@aiede.svl.corp.google.com>
- In-Reply-To
- <20180905202613.GA20473@blodeuwedd>
Hi,
Jelmer Vernooij wrote[1]:
Show 6 quoted lines
> Git's http-backend has become slightly stricter about the content > of the CONTENT_LENGTH variable. Previously, Dulwich would leave this > variable empty but git now expects it to be set to 0 for GET requests > without a body. > > I'm uploading a fixed version of dulwich.
Thanks for tracking it down! This is likely due to v2.19.0-rc0~45^2~2 (http-backend: respect CONTENT_LENGTH as specified by rfc3875, 2018-06-10).
Max, RFC 3875 appears to allow a CONTENT_LENGTH of "" when no data is attached to the request. Should we check for this case (e.g. inserting a *str check in
if (str && !git_parse_ssize_t(str, &val))
die("failed to parse CONTENT_LENGTH: %s", str);?
Thanks, Jonathan
[1] https://bugs.debian.org/907587