[vlc-commits] http: tighten redirection to the MMS module (fixes #19657)

Rémi Denis-Courmont git at videolan.org
Sun Feb 11 10:16:11 CET 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Feb 11 11:13:22 2018 +0200| [ce921f1e3c3cc42ba6292443d2b44e80efcf5eb4] | committer: Rémi Denis-Courmont

http: tighten redirection to the MMS module (fixes #19657)

Match the exact same "logic" as in previous VLC versions, i.e. only
if the Pragma header is exactly equal to "features", rather than
contains the "features" token.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ce921f1e3c3cc42ba6292443d2b44e80efcf5eb4
---

 modules/access/http/resource.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/access/http/resource.c b/modules/access/http/resource.c
index 4f49a4bff6..9a28bb50f3 100644
--- a/modules/access/http/resource.c
+++ b/modules/access/http/resource.c
@@ -256,7 +256,8 @@ char *vlc_http_res_get_redirect(struct vlc_http_resource *restrict res)
         char *url;
 
         /* HACK: Seems like an MMS server. Redirect to MMSH scheme. */
-        if (vlc_http_msg_get_token(res->response, "Pragma", "features") != NULL
+        const char *pragma = vlc_http_msg_get_header(res->response, "Pragma");
+        if (pragma != NULL && !vlc_ascii_strcasecmp(pragma, "features")
          && asprintf(&url, "mmsh://%s%s", res->authority, res->path) >= 0)
             return url;
 



More information about the vlc-commits mailing list