summaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorAndrey Utkin <andrey.utkin@corp.bluecherry.net>2015-10-01 13:56:31 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2015-10-07 00:10:16 +0200
commitfdb32838723effb4560a345013387ea37b85ff20 (patch)
treeb58f07d4f2a1463ebcdc5b9db16ca54ab5dd741e /libavformat
parentac74e857a26583f67d5518c805cfc23f2a482f2b (diff)
downloadffmpeg-streaming-fdb32838723effb4560a345013387ea37b85ff20.zip
ffmpeg-streaming-fdb32838723effb4560a345013387ea37b85ff20.tar.gz
avformat/httpauth: Add space after commas in HTTP/RTSP auth header
This fixes access to Grandstream cameras, which return 401 to ffmpeg otherwise. VLC sends Authorization: header with spaces between parameters, and it is known to work with Grandstream devices and broad range of other HTTP and RTSP servers, so author considers switching to such behaviour safe. Just for record - RFC 2617 (HTTP Auth) does not specify the need in spaces, so this is not a bug of FFmpeg. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/httpauth.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/libavformat/httpauth.c b/libavformat/httpauth.c
index dbe3eff..18cf36b 100644
--- a/libavformat/httpauth.c
+++ b/libavformat/httpauth.c
@@ -220,21 +220,21 @@ static char *make_digest_auth(HTTPAuthState *state, const char *username,
/* TODO: Escape the quoted strings properly. */
av_strlcatf(authstr, len, "username=\"%s\"", username);
- av_strlcatf(authstr, len, ",realm=\"%s\"", state->realm);
- av_strlcatf(authstr, len, ",nonce=\"%s\"", digest->nonce);
- av_strlcatf(authstr, len, ",uri=\"%s\"", uri);
- av_strlcatf(authstr, len, ",response=\"%s\"", response);
+ av_strlcatf(authstr, len, ", realm=\"%s\"", state->realm);
+ av_strlcatf(authstr, len, ", nonce=\"%s\"", digest->nonce);
+ av_strlcatf(authstr, len, ", uri=\"%s\"", uri);
+ av_strlcatf(authstr, len, ", response=\"%s\"", response);
// we are violating the RFC and use "" because all others seem to do that too.
if (digest->algorithm[0])
- av_strlcatf(authstr, len, ",algorithm=\"%s\"", digest->algorithm);
+ av_strlcatf(authstr, len, ", algorithm=\"%s\"", digest->algorithm);
if (digest->opaque[0])
- av_strlcatf(authstr, len, ",opaque=\"%s\"", digest->opaque);
+ 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, ",nc=%s", nc);
+ av_strlcatf(authstr, len, ", qop=\"%s\"", digest->qop);
+ av_strlcatf(authstr, len, ", cnonce=\"%s\"", cnonce);
+ av_strlcatf(authstr, len, ", nc=%s", nc);
}
av_strlcatf(authstr, len, "\r\n");
OpenPOWER on IntegriCloud