Skip to content

Commit

Permalink
avformat/http: Properly handle cookies that specify sub-domain where …
Browse files Browse the repository at this point in the history
…the URL.

Fixes ticket #3336

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  • Loading branch information
Eli Kara authored and michaelni committed Jan 23, 2014
1 parent 306e1ac commit da25a65
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libavformat/http.c
Expand Up @@ -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) ||
Expand Down

0 comments on commit da25a65

Please sign in to comment.