Re: --local and redirection

Jorge Arellano Cid <[email protected]>
Newsgroups gmane.comp.web.dillo.devel
Message-ID <[email protected]>
On Sat, Dec 20, 2014 at 01:09:04AM +0000, eocene wrote:
> Jorge wrote:
> > On Wed, Dec 17, 2014 at 06:30:30PM +0000, eocene wrote:
> > > 
> > > I notice that redirection defeats --local.
> > > You go to www.dillo.org and images aren't loaded.
> > > You go to dillo.org, it redirects to www.dillo.org, and images are loaded.
> > 
> >   Oh, yes.
> > 
> >   Originally,  --local  was  meant for local files only. To allow
> > safe displaying of HTML email in sylpheed (IIRC).
> > 
> >   Now,  from  the  console  help given by dillo, it seems like it
> > should  work  with  non-local  URLs  too.  It  makes sense to me,
> > although  I  haven't  found a compelling use case for that. Maybe
> > for opening news site without the images...
> > 
> >   Attached is a brief patch. Please test and send feedback.
> 
> It appears to fix the case that I mentioned, but then I tried a local file like
> 
> <head>
> <meta http-equiv="refresh" content="0; url=http://example.com/">
> </head>
> <body>
> text
> </body>
> 
> and the redirection is followed.

  Please try the attached patch.

-- 
  Cheers
  Jorge.-

_______________________________________________
Dillo-dev mailing list
[email protected]
http://lists.dillo.org/cgi-bin/mailman/listinfo/dillo-dev
meta.diff (text/x-diff, 820 B)
diff -r 8d0684e0c85c src/html.cc
--- a/src/html.cc       Wed Dec 10 17:43:00 2014 +0000
+++ b/src/html.cc       Sat Dec 20 17:04:46 2014 -0300
@@ -3172,8 +3172,12 @@ static void Html_tag_open_meta(DilloHtml
          } else if (delay == 0) {
             /* zero-delay redirection */
             html->stop_parser = true;
-            if (a_Capi_dpi_verify_request(html->bw, new_url))
+            if (URL_FLAGS(html->base_url) & URL_SpamSafe) {
+               a_UIcmd_set_msg(html->bw,
+                  "WARNING: local URL with META refresh.  Aborting.");
+            } else if (a_Capi_dpi_verify_request(html->bw, new_url)) {
                a_UIcmd_redirection0((void*)html->bw, new_url);
+            }
          } else {
             /* Send a custom HTML message.
              * TODO: This is a hairy hack,
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.