]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
fts: Don't add NULL content disposition or type to HTTP header
authorMartti Rannanjärvi <martti.rannanjarvi@dovecot.fi>
Wed, 1 Mar 2017 10:29:17 +0000 (12:29 +0200)
committerMartti Rannanjärvi <martti.rannanjarvi@dovecot.fi>
Wed, 1 Mar 2017 10:29:17 +0000 (12:29 +0200)
src/plugins/fts/fts-parser-tika.c

index 8457f28f26eeb4e5b4a48ed9f86594e417595bec..385f1d0fda3a1f9e03475d9211137c7999e23c31 100644 (file)
@@ -158,9 +158,12 @@ fts_parser_tika_try_init(struct mail_user *user, const char *content_type,
                        fts_tika_parser_response, parser);
        http_client_request_set_port(http_req, http_url->port);
        http_client_request_set_ssl(http_req, http_url->have_ssl);
-       http_client_request_add_header(http_req, "Content-Type", content_type);
-       http_client_request_add_header(http_req, "Content-Disposition",
-                                      content_disposition);
+       if (content_type != NULL)
+               http_client_request_add_header(http_req, "Content-Type",
+                                              content_type);
+       if (content_disposition != NULL)
+               http_client_request_add_header(http_req, "Content-Disposition",
+                                              content_disposition);
        http_client_request_add_header(http_req, "Accept", "text/plain");
 
        parser->http_req = http_req;