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.
This commit is contained in:
parent
a80cde8cb6
commit
8a8d3ac351
@ -352,10 +352,12 @@ gst_curl_http_sink_set_header_unlocked (GstCurlBaseSink * bcsink)
|
|||||||
|
|
||||||
set_headers:
|
set_headers:
|
||||||
|
|
||||||
|
if (bcsink->file_name) {
|
||||||
tmp = g_strdup_printf ("Content-Disposition: attachment; filename="
|
tmp = g_strdup_printf ("Content-Disposition: attachment; filename="
|
||||||
"\"%s\"", bcsink->file_name);
|
"\"%s\"", bcsink->file_name);
|
||||||
sink->header_list = curl_slist_append (sink->header_list, tmp);
|
sink->header_list = curl_slist_append (sink->header_list, tmp);
|
||||||
g_free (tmp);
|
g_free (tmp);
|
||||||
|
}
|
||||||
res = curl_easy_setopt (bcsink->curl, CURLOPT_HTTPHEADER, sink->header_list);
|
res = curl_easy_setopt (bcsink->curl, CURLOPT_HTTPHEADER, sink->header_list);
|
||||||
if (res != CURLE_OK) {
|
if (res != CURLE_OK) {
|
||||||
bcsink->error = g_strdup_printf ("failed to set HTTP headers: %s",
|
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);
|
parent_class = GST_CURL_TLS_SINK_GET_CLASS (sink);
|
||||||
|
|
||||||
if (g_str_has_prefix (bcsink->url, "https://")) {
|
if (g_str_has_prefix (bcsink->url, "https://")) {
|
||||||
|
GST_DEBUG_OBJECT (bcsink, "setting up tls options");
|
||||||
return parent_class->set_options_unlocked (bcsink);
|
return parent_class->set_options_unlocked (bcsink);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user