From 8a8d3ac3517d56d3aa9b6da66ff55f5aa5f88ee8 Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Wed, 24 Sep 2014 22:24:49 +0200 Subject: [PATCH] curlhttpsink: only add content-disposition header if a filename is set The header is optional and therefore we better omit it if we don't have a filename. --- ext/curl/gstcurlhttpsink.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ext/curl/gstcurlhttpsink.c b/ext/curl/gstcurlhttpsink.c index 6fa920ad21..a8d80d28df 100644 --- a/ext/curl/gstcurlhttpsink.c +++ b/ext/curl/gstcurlhttpsink.c @@ -352,10 +352,12 @@ gst_curl_http_sink_set_header_unlocked (GstCurlBaseSink * bcsink) set_headers: - tmp = g_strdup_printf ("Content-Disposition: attachment; filename=" - "\"%s\"", bcsink->file_name); - sink->header_list = curl_slist_append (sink->header_list, tmp); - g_free (tmp); + if (bcsink->file_name) { + tmp = g_strdup_printf ("Content-Disposition: attachment; filename=" + "\"%s\"", bcsink->file_name); + sink->header_list = curl_slist_append (sink->header_list, tmp); + g_free (tmp); + } res = curl_easy_setopt (bcsink->curl, CURLOPT_HTTPHEADER, sink->header_list); if (res != CURLE_OK) { bcsink->error = g_strdup_printf ("failed to set HTTP headers: %s", @@ -399,6 +401,7 @@ gst_curl_http_sink_set_options_unlocked (GstCurlBaseSink * bcsink) parent_class = GST_CURL_TLS_SINK_GET_CLASS (sink); if (g_str_has_prefix (bcsink->url, "https://")) { + GST_DEBUG_OBJECT (bcsink, "setting up tls options"); return parent_class->set_options_unlocked (bcsink); }