summaryrefslogtreecommitdiff
path: root/libavformat/http.c
diff options
context:
space:
mode:
authorEli Kara <eli@algotec.co.il>2014-01-23 08:34:20 +0000
committerMichael Niedermayer <michaelni@gmx.at>2014-01-23 14:39:36 +0100
commitda25a6573f9c2faa557a86a6f9cd6f73ca233b54 (patch)
tree17bf125a6e97e76eef41db0229069b293decc369 /libavformat/http.c
parent306e1ac012d00f1ac9a8c9547a5c72b052de2dd4 (diff)
avformat/http: Properly handle cookies that specify sub-domain where the URL.
Fixes ticket #3336 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/http.c')
-rw-r--r--libavformat/http.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/http.c b/libavformat/http.c
index 3b655c6673..69c4d6d7a0 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -490,8 +490,11 @@ static int get_cookies(HTTPContext *s, char **cookies, const char *path,
av_free(cpath);
cpath = av_strdup(&param[5]);
} else if (!av_strncasecmp("domain=", param, 7)) {
+ // if the cookie specifies a sub-domain, skip the leading dot thereby
+ // supporting URLs that point to sub-domains and the master domain
+ int leading_dot = (param[7] == '.');
av_free(cdomain);
- cdomain = av_strdup(&param[7]);
+ cdomain = av_strdup(&param[7+leading_dot]);
} else if (!av_strncasecmp("secure", param, 6) ||
!av_strncasecmp("comment", param, 7) ||
!av_strncasecmp("max-age", param, 7) ||