Re: --local and redirection

Jorge Arellano Cid <[email protected]>
Newsgroups gmane.comp.web.dillo.devel
Message-ID <[email protected]>
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.

-- 
  Cheers
  Jorge.-

_______________________________________________
Dillo-dev mailing list
[email protected]
http://lists.dillo.org/cgi-bin/mailman/listinfo/dillo-dev
local.diff (text/x-diff, 613 B)
diff -r 8d0684e0c85c src/cache.c
--- a/src/cache.c       Wed Dec 10 17:43:00 2014 +0000
+++ b/src/cache.c       Fri Dec 19 17:20:48 2014 -0300
@@ -953,14 +953,20 @@ static int Cache_redirect(CacheEntry_t *
 
    _MSG(" Cache_redirect: redirect_level = %d\n", bw->redirect_level);
 
+   /* Don't allow redirection for SpamSafe/local URLs */
+   if (URL_FLAGS(entry->Url) & URL_SpamSafe) {
+      a_UIcmd_set_msg(bw, "WARNING: local URL with redirection.  Aborting.");
+      return 0;
+   }
+
    /* if there's a redirect loop, stop now */
    if (bw->redirect_level >= 5)
       entry->Flags |= CA_RedirectLoop;
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.