From 76aa92be518e1c271116682b1bda3bc98d213129 Mon Sep 17 00:00:00 2001 From: Per Forlin Date: Fri, 30 Nov 2018 13:37:26 +0100 Subject: [PATCH] rtspconnection: Replace Auth header instead of append gst_rtsp_connection_send() adds the Authorization header to the request. If this function is being called multiple times with the same request it will add one more Authorization header every time. To fix to this issue do not append a new Authorization header on top of an existing ones. Remove any existing Authorization headers first and then add the new one. Fixes gst-plugins-good#425 --- gst-libs/gst/rtsp/gstrtspconnection.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gst-libs/gst/rtsp/gstrtspconnection.c b/gst-libs/gst/rtsp/gstrtspconnection.c index d134666002..7926f59e48 100644 --- a/gst-libs/gst/rtsp/gstrtspconnection.c +++ b/gst-libs/gst/rtsp/gstrtspconnection.c @@ -1088,6 +1088,8 @@ add_auth_header (GstRTSPConnection * conn, GstRTSPMessage * message) g_free (auth_string); auth_string = auth_string2; } + /* Do not keep any old Authorization headers */ + gst_rtsp_message_remove_header (message, GST_RTSP_HDR_AUTHORIZATION, -1); gst_rtsp_message_take_header (message, GST_RTSP_HDR_AUTHORIZATION, auth_string); break;