From 396a14fcef284c9b035c475c4838984c3ad0e36d Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sat, 12 Dec 2015 16:56:05 +0100 Subject: [PATCH] avformat/httpauth: change order of qop parameters This fixes a bug when interacting with some (broken) HTTP servers which expect the last entry to be a quoted string. Also remove the quoting of the qop parameter in the process, it violates the specification. --- libavformat/httpauth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/httpauth.c b/libavformat/httpauth.c index 9780928357..b7c4e3f3b1 100644 --- a/libavformat/httpauth.c +++ b/libavformat/httpauth.c @@ -226,9 +226,9 @@ static char *make_digest_auth(HTTPAuthState *state, const char *username, if (digest->opaque[0]) av_strlcatf(authstr, len, ", opaque=\"%s\"", digest->opaque); if (digest->qop[0]) { - av_strlcatf(authstr, len, ", qop=\"%s\"", digest->qop); - av_strlcatf(authstr, len, ", cnonce=\"%s\"", cnonce); + av_strlcatf(authstr, len, ", qop=%s", digest->qop); av_strlcatf(authstr, len, ", nc=%s", nc); + av_strlcatf(authstr, len, ", cnonce=\"%s\"", cnonce); } av_strlcatf(authstr, len, "\r\n");