<!DOCTYPE html><html><head><title></title><style type="text/css">
p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div>Maybe this fixup should be done at the interface level when we receive URLs from the user ?<br></div><div><br></div><div>On Fri, Oct 9, 2020, at 09:41, Thomas Guillem wrote:<br></div><blockquote type="cite" id="qt" style=""><div>I remember a previous discussion where we said it was the responsibility of the access modules to do this fixup.<br></div><div><br></div><div>cf. <a href="https://trac.videolan.org/vlc/ticket/18991">https://trac.videolan.org/vlc/ticket/18991</a> and <a href="https://git.videolan.org/?p=vlc.git;a=commit;h=762ca1e8a01278b34ddb34765f3339690aad5d2e">https://git.videolan.org/?p=vlc.git;a=commit;h=762ca1e8a01278b34ddb34765f3339690aad5d2e</a><br></div><div><br></div><div>I'm not sure that URLs are fixed up at this point.<br></div><div><br></div><div>How do you propose to fix <a href="https://trac.videolan.org/vlc/ticket/3435" class="qt-trac-id">#3435</a> 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.<br></div><div><br></div><div>On Fri, Oct 9, 2020, at 09:26, Rémi Denis-Courmont wrote:<br></div><blockquote type="cite" id="qt-qt" style=""><div>URLs are already fixed up when they get to this point. Fixing up URLs twice is a recipe for disaster. We've tried.<br></div><div><br></div><div>-1<br></div><div><br></div><div class="qt-qt-gmail_quote"><div>Le 9 octobre 2020 09:56:58 GMT+03:00, Thomas Guillem <thomas@gllm.fr> a écrit :<br></div><blockquote class="qt-qt-gmail_quote" style="margin-top:0pt;margin-right:0pt;margin-bottom:0pt;margin-left:0.8ex;border-left-color:rgb(204, 204, 204);border-left-style:solid;border-left-width:1px;padding-left:1ex;"><pre class="qt-qt-k9mail"><div>This will allow VLC to open unvalid URLs (using a space instead of the<br></div><div>%20 encoding, for example). Every other browsers or players are doing<br></div><div>this fixup.<br></div><div><br></div><div>Fixes #3435<hr> modules/access/http/access.c | 12 ++++++++++--<br></div><div> 1 file changed, 10 insertions(+), 2 deletions(-)<br></div><div><br></div><div>diff --git a/modules/access/http/access.c b/modules/access/http/access.c<br></div><div>index a3805d0d426..123daaf51d3 100644<br></div><div>--- a/modules/access/http/access.c<br></div><div>+++ b/modules/access/http/access.c<br></div><div>@@ -171,19 +171,27 @@ static int Open(vlc_object_t *obj)<br></div><div>     struct vlc_url_t crd_url;<br></div><div>     char *psz_realm = NULL;<br></div><div> <br></div><div>-    vlc_UrlParse(&crd_url, access->psz_url);<br></div><div>+    char *url_fixup = vlc_uri_fixup(access->psz_url);<br></div><div>+    if (url_fixup == NULL)<br></div><div>+        goto error;<br></div><div>+<br></div><div>+    vlc_UrlParse(&crd_url, url_fixup);<br></div><div>     vlc_credential_init(&crd, &crd_url);<br></div><div> <br></div><div>     sys->manager = vlc_http_mgr_create(obj, jar);<br></div><div>     if (sys->manager == NULL)<br></div><div>+    {<br></div><div>+        free(url_fixup);<br></div><div>         goto error;<br></div><div>+    }<br></div><div> <br></div><div>     char *ua = var_InheritString(obj, "http-user-agent");<br></div><div>     char *referer = var_InheritString(obj, "http-referrer");<br></div><div>     bool live = var_InheritBool(obj, "http-continuous");<br></div><div> <br></div><div>     sys->resource = (live ? vlc_http_live_create : vlc_http_file_create)(<br></div><div>-        sys->manager, access->psz_url, ua, referer);<br></div><div>+        sys->manager, url_fixup, ua, referer);<br></div><div>+    free(url_fixup);<br></div><div>     free(referer);<br></div><div>     free(ua); <br></div></pre></blockquote></div><div><br></div><div>-- <br></div><div>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté. <br></div><div>_______________________________________________<br></div><div>vlc-devel mailing list<br></div><div>To unsubscribe or modify your subscription options:<br></div><div><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></div></blockquote><div><br></div><div>_______________________________________________<br></div><div>vlc-devel mailing list<br></div><div>To unsubscribe or modify your subscription options:<br></div><div><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></div></blockquote><div><br></div></body></html>