[vlc-devel] [PATCH 1/2] http2: fix up URLs
Thomas Guillem
thomas at gllm.fr
Fri Oct 9 09:54:08 CEST 2020
Maybe this fixup should be done at the interface level when we receive URLs from the user ?
On Fri, Oct 9, 2020, at 09:41, Thomas Guillem wrote:
> I remember a previous discussion where we said it was the responsibility of the access modules to do this fixup.
>
> cf. https://trac.videolan.org/vlc/ticket/18991 and https://git.videolan.org/?p=vlc.git;a=commit;h=762ca1e8a01278b34ddb34765f3339690aad5d2e
>
> I'm not sure that URLs are fixed up at this point.
>
> How do you propose to fix #3435 <https://trac.videolan.org/vlc/ticket/3435> then? Because you said it was fixed but it is *not*. VLC can't handle unvalid http URLs with a " ". Every other player or browsers can.
>
> On Fri, Oct 9, 2020, at 09:26, Rémi Denis-Courmont wrote:
>> 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);
>>
>> --
>> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20201009/60c901bb/attachment.html>
More information about the vlc-devel
mailing list