aboutsummaryrefslogtreecommitdiff
path: root/block/curl.c
diff options
context:
space:
mode:
authorDavid Edmondson <david.edmondson@oracle.com>2020-02-24 10:13:10 +0000
committerMax Reitz <mreitz@redhat.com>2020-03-11 12:42:29 +0100
commit69032253c33ae1774233c63cedf36d32242a85fc (patch)
treefe0b1ce9ca160ac44cd4be9604aa5d35881ae5c9 /block/curl.c
parent7788a319399f17476ff1dd43164c869e320820a2 (diff)
block/curl: HTTP header field names are case insensitive
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>
Diffstat (limited to 'block/curl.c')
-rw-r--r--block/curl.c5
1 files 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;