[libsoup/pgriffis/content-type-regression] headers: Fix parsing of Content-Type




commit e0fb48a0a348af5514be515c2c84666a5a8f7c85
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 2dfea525..ebcecb9f 100644
--- a/libsoup/soup-message-headers.c
+++ b/libsoup/soup-message-headers.c
@@ -1453,7 +1453,8 @@ parse_content_foo (SoupMessageHeaders *hdrs,
          * 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]