All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: [PULL 06/19] block/curl: HTTP header field names are case insensitive
Date: Wed, 11 Mar 2020 14:52:00 +0100	[thread overview]
Message-ID: <20200311135213.1242028-7-mreitz@redhat.com> (raw)
In-Reply-To: <20200311135213.1242028-1-mreitz@redhat.com>

From: David Edmondson <david.edmondson@oracle.com>

RFC 7230 section 3.2 indicates that HTTP header field names are case
insensitive.

Signed-off-by: David Edmondson <david.edmondson@oracle.com>
Message-Id: <20200224101310.101169-3-david.edmondson@oracle.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 block/curl.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/block/curl.c b/block/curl.c
index f9ffb7f4e2..6e325901dc 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -216,11 +216,12 @@ static size_t curl_header_cb(void *ptr, size_t size, size_t nmemb, void *opaque)
     size_t realsize = size * nmemb;
     const char *header = (char *)ptr;
     const char *end = header + realsize;
-    const char *accept_ranges = "Accept-Ranges:";
+    const char *accept_ranges = "accept-ranges:";
     const char *bytes = "bytes";
 
     if (realsize >= strlen(accept_ranges)
-        && strncmp(header, accept_ranges, strlen(accept_ranges)) == 0) {
+        && g_ascii_strncasecmp(header, accept_ranges,
+                               strlen(accept_ranges)) == 0) {
 
         char *p = strchr(header, ':') + 1;
 
-- 
2.24.1



  parent reply	other threads:[~2020-03-11 14:06 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11 13:51 [PULL 00/19] Block patches Max Reitz
2020-03-11 13:51 ` [PULL 01/19] luks: extract qcrypto_block_calculate_payload_offset() Max Reitz
2020-03-11 13:51 ` [PULL 02/19] luks: implement .bdrv_measure() Max Reitz
2020-03-11 13:51 ` [PULL 03/19] qemu-img: allow qemu-img measure --object without a filename Max Reitz
2020-03-11 13:51 ` [PULL 04/19] iotests: add 288 luks qemu-img measure test Max Reitz
2020-03-11 13:51 ` [PULL 05/19] block/curl: HTTP header fields allow whitespace around values Max Reitz
2020-03-11 13:52 ` Max Reitz [this message]
2020-03-11 13:52 ` [PULL 07/19] iotests: Fix nonportable use of od --endian Max Reitz
2020-03-11 13:52 ` [PULL 08/19] block/qcow2: do free crypto_opts in qcow2_close() Max Reitz
2020-03-11 13:52 ` [PULL 09/19] qemu-img: free memory before re-assign Max Reitz
2020-03-11 13:52 ` [PULL 10/19] block/qcow2-threads: fix qcow2_decompress Max Reitz
2020-03-11 13:52 ` [PULL 11/19] job: refactor progress to separate object Max Reitz
2020-03-11 13:52 ` [PULL 12/19] block/block-copy: fix progress calculation Max Reitz
2020-03-11 13:52 ` [PULL 13/19] block/block-copy: specialcase first copy_range request Max Reitz
2020-03-11 13:52 ` [PULL 14/19] block/block-copy: use block_status Max Reitz
2020-03-11 13:52 ` [PULL 15/19] block/block-copy: factor out find_conflicting_inflight_req Max Reitz
2020-03-11 13:52 ` [PULL 16/19] block/block-copy: refactor interfaces to use bytes instead of end Max Reitz
2020-03-11 13:52 ` [PULL 17/19] block/block-copy: rename start to offset in interfaces Max Reitz
2020-03-11 13:52 ` [PULL 18/19] block/block-copy: reduce intersecting request lock Max Reitz
2020-03-11 13:52 ` [PULL 19/19] block/block-copy: hide structure definitions Max Reitz
2020-03-12 11:02 ` [PULL 00/19] Block patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200311135213.1242028-7-mreitz@redhat.com \
    --to=mreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.