diff options
author | Per Forlin <per.forlin@axis.com> | 2018-11-30 13:37:26 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2019-05-01 17:17:00 +0100 |
commit | f749145b30bd8146549390602e236389da8e379b (patch) | |
tree | 9f7124f705d4b18027ffe3bdd1a33923de45833e | |
parent | a54dbec4c2c66e0753561e551cb14b0344012095 (diff) | |
download | gstreamer-plugins-base-f749145b30bd8146549390602e236389da8e379b.tar.gz |
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
-rw-r--r-- | gst-libs/gst/rtsp/gstrtspconnection.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gst-libs/gst/rtsp/gstrtspconnection.c b/gst-libs/gst/rtsp/gstrtspconnection.c index 3f48f8b11..c3a3a95c2 100644 --- a/gst-libs/gst/rtsp/gstrtspconnection.c +++ b/gst-libs/gst/rtsp/gstrtspconnection.c @@ -1087,6 +1087,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; |