[vlc-devel] [PATCH 1/2] http2: fix up URLs
Rémi Denis-Courmont
remi at remlab.net
Fri Oct 9 09:26:23 CEST 2020
URLs are already fixed up when they get to this point. Fixing up URLs twice is a recipe for disaster. We've tried.
-1
Le 9 octobre 2020 09:56:58 GMT+03:00, Thomas Guillem <thomas at gllm.fr> a écrit :
>This will allow VLC to open unvalid URLs (using a space instead of the
>%20 encoding, for example). Every other browsers or players are doing
>this fixup.
>
>Fixes #3435
>---
> modules/access/http/access.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
>diff --git a/modules/access/http/access.c
>b/modules/access/http/access.c
>index a3805d0d426..123daaf51d3 100644
>--- a/modules/access/http/access.c
>+++ b/modules/access/http/access.c
>@@ -171,19 +171,27 @@ static int Open(vlc_object_t *obj)
> struct vlc_url_t crd_url;
> char *psz_realm = NULL;
>
>- vlc_UrlParse(&crd_url, access->psz_url);
>+ char *url_fixup = vlc_uri_fixup(access->psz_url);
>+ if (url_fixup == NULL)
>+ goto error;
>+
>+ vlc_UrlParse(&crd_url, url_fixup);
> vlc_credential_init(&crd, &crd_url);
>
> sys->manager = vlc_http_mgr_create(obj, jar);
> if (sys->manager == NULL)
>+ {
>+ free(url_fixup);
> goto error;
>+ }
>
> char *ua = var_InheritString(obj, "http-user-agent");
> char *referer = var_InheritString(obj, "http-referrer");
> bool live = var_InheritBool(obj, "http-continuous");
>
> sys->resource = (live ? vlc_http_live_create : vlc_http_file_create)(
>- sys->manager, access->psz_url, ua, referer);
>+ sys->manager, url_fixup, ua, referer);
>+ free(url_fixup);
> free(referer);
> free(ua);
>
>--
>2.28.0
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel
--
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20201009/628fb979/attachment-0001.html>
More information about the vlc-devel
mailing list