[libsoup/gnome-3-38] headers: Fix parsing of Content-Type



commit 4bbc39f30a48e38d7c60a375a88d2a2e6a41a0b8
Author: Patrick Griffis <pgriffis igalia com>
Date:   Thu Jul 22 10:20:56 2021 -0500

    headers: Fix parsing of Content-Type
    
    With d9f97292 the intention was only to change the behavior of 
soup_message_headers_get_content_disposition()
    however parse_content_foo() is also used for Content-Type.
    
    Fixes #232

 libsoup/soup-message-headers.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/libsoup/soup-message-headers.c b/libsoup/soup-message-headers.c
index aaf496e7..b6b3827b 100644
--- a/libsoup/soup-message-headers.c
+++ b/libsoup/soup-message-headers.c
@@ -1283,7 +1283,8 @@ parse_content_foo (SoupMessageHeaders *hdrs, const char *header_name,
          * is a parameter (foo=bar). */
         equal = strchr (header, '=');
         semi = strchr (header, ';');
-        if (equal && (!semi || (equal < semi))) {
+        if (header_name == SOUP_HEADER_CONTENT_DISPOSITION &&
+            (equal && (!semi || (equal < semi)))) {
                 semi = (char *)header;
                 if (foo)
                         *foo = NULL;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]