From 8b692d697f4be5cd90b8a7c00505938d3dae2dcd Mon Sep 17 00:00:00 2001 From: Jacek Roszkowski Date: Mon, 7 Dec 2020 01:59:19 +0100 Subject: The type, subtype, and parameter name tokens of Content-Type header are case-insensitive. https://tools.ietf.org/html/rfc7231#section-3.1.1.1 --- src/activation.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/activation.c b/src/activation.c index 9e7115a..d66f7ee 100644 --- a/src/activation.c +++ b/src/activation.c @@ -603,13 +603,13 @@ static size_t idevice_activation_header_callback(void *data, size_t size, size_t } if (value) { if (strncasecmp(header, "Content-Type", 12) == 0) { - if (strcmp(value, "text/xml") == 0) { + if (strncasecmp(value, "text/xml", 8) == 0) { response->content_type = IDEVICE_ACTIVATION_CONTENT_TYPE_PLIST; - } else if (strcmp(value, "application/xml") == 0) { + } else if (strncasecmp(value, "application/xml", 15) == 0) { response->content_type = IDEVICE_ACTIVATION_CONTENT_TYPE_PLIST; - } else if (strcmp(value, "application/x-buddyml") == 0) { + } else if (strncasecmp(value, "application/x-buddyml", 21) == 0) { response->content_type = IDEVICE_ACTIVATION_CONTENT_TYPE_BUDDYML; - } else if (strcmp(value, "text/html") == 0) { + } else if (strncasecmp(value, "text/html", 9) == 0) { response->content_type = IDEVICE_ACTIVATION_CONTENT_TYPE_HTML; } } -- cgit v1.1-32-gdbae