From dede842409cdda579be00eca0f17e242e0b6f34b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 28 Apr 2014 10:12:52 +0200 Subject: [PATCH] uridownloader: Unset referer if none was specified later on --- gst-libs/gst/uridownloader/gsturidownloader.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/gst-libs/gst/uridownloader/gsturidownloader.c b/gst-libs/gst/uridownloader/gsturidownloader.c index 8614c44f6b..45f53439a5 100644 --- a/gst-libs/gst/uridownloader/gsturidownloader.c +++ b/gst-libs/gst/uridownloader/gsturidownloader.c @@ -378,14 +378,19 @@ gst_uri_downloader_set_uri (GstUriDownloader * downloader, const gchar * uri, g_object_set (downloader->priv->urisrc, "compress", compress, NULL); if (g_object_class_find_property (gobject_class, "keep-alive")) g_object_set (downloader->priv->urisrc, "keep-alive", TRUE, NULL); - if (referer && g_object_class_find_property (gobject_class, "extra-headers")) { - GstStructure *extra_headers = - gst_structure_new ("headers", "Referer", G_TYPE_STRING, referer, NULL); + if (g_object_class_find_property (gobject_class, "extra-headers")) { + if (referer) { + GstStructure *extra_headers = + gst_structure_new ("headers", "Referer", G_TYPE_STRING, referer, + NULL); - g_object_set (downloader->priv->urisrc, "extra-headers", extra_headers, - NULL); + g_object_set (downloader->priv->urisrc, "extra-headers", extra_headers, + NULL); - gst_structure_free (extra_headers); + gst_structure_free (extra_headers); + } else { + g_object_set (downloader->priv->urisrc, "extra-headers", NULL, NULL); + } } /* add a sync handler for the bus messages to detect errors in the download */