[PATCH v3 0/2] block/curl: Improve HTTP header parsing

David Edmondson posted 2 patches 4 years, 2 months ago
Test docker-quick@centos7 passed
Test FreeBSD passed
Test docker-mingw@fedora passed
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200224101310.101169-1-david.edmondson@oracle.com
Maintainers: Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>
block/curl.c | 32 ++++++++++++++++++++++++++++----
1 file changed, 28 insertions(+), 4 deletions(-)
[PATCH v3 0/2] block/curl: Improve HTTP header parsing
Posted by David Edmondson 4 years, 2 months ago
An HTTP object store of my acquaintance returns "accept-ranges: bytes"
(all lower case) as a header, causing the QEMU curl backend to refuse
to talk to it. RFC 7230 says that HTTP headers are case insensitive,
so update the curl backend accordingly.

At the same time, allow for arbitrary white space around the HTTP
header field value, as required by the RFC.

v3:
- fix line length.

v2:
- strncasecmp -> g_ascii_strncasecmp (Philippe).
- isspace -> g_ascii_isspace, for good measure.

David Edmondson (2):
  block/curl: HTTP header fields allow whitespace around values
  block/curl: HTTP header field names are case insensitive

 block/curl.c | 32 ++++++++++++++++++++++++++++----
 1 file changed, 28 insertions(+), 4 deletions(-)

-- 
2.24.1


Re: [PATCH v3 0/2] block/curl: Improve HTTP header parsing
Posted by Max Reitz 4 years, 2 months ago
On 24.02.20 11:13, David Edmondson wrote:
> An HTTP object store of my acquaintance returns "accept-ranges: bytes"
> (all lower case) as a header, causing the QEMU curl backend to refuse
> to talk to it. RFC 7230 says that HTTP headers are case insensitive,
> so update the curl backend accordingly.
> 
> At the same time, allow for arbitrary white space around the HTTP
> header field value, as required by the RFC.

Thanks, applied to my block branch:

https://git.xanclic.moe/XanClic/qemu/commits/branch/block

Max