]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/http.c
Merge commit '25a1ba814ad80056247fd357ec4c6911324a3f66'
[ffmpeg] / libavformat / http.c
index 3b655c66732d13ba9eb9457e8f572ee15050c765..69c4d6d7a097c832b59c69bc2f2ed779e88393e8 100644 (file)
@@ -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) ||