[vlc-devel] [PATCH 1/2] http2: fix up URLs
Thomas Guillem
thomas at gllm.fr
Fri Oct 9 08:56:58 CEST 2020
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
More information about the vlc-devel
mailing list