changeset 21712:53204258adfd

fts: Don't add NULL content disposition or type to HTTP header
author Martti Rannanj?rvi <martti.rannanjarvi@dovecot.fi>
date Wed, 01 Mar 2017 12:29:17 +0200
parents 5fe535e0972a
children 311c42d6897e
files src/plugins/fts/fts-parser-tika.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/fts/fts-parser-tika.c	Mon Feb 27 20:40:43 2017 +0200
+++ b/src/plugins/fts/fts-parser-tika.c	Wed Mar 01 12:29:17 2017 +0200
@@ -152,9 +152,12 @@
 			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;