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
This commit is contained in:
Per Forlin 2018-11-30 13:37:26 +01:00 committed by Sebastian Dröge
parent 0bec36d5fa
commit 76aa92be51

View file

@ -1088,6 +1088,8 @@ add_auth_header (GstRTSPConnection * conn, GstRTSPMessage * message)
g_free (auth_string); g_free (auth_string);
auth_string = auth_string2; 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, gst_rtsp_message_take_header (message, GST_RTSP_HDR_AUTHORIZATION,
auth_string); auth_string);
break; break;