changeset 1651:cef38874b78f

allow image/stylesheet redirection if using filter
author corvid <corvid@lavabit.com>
date Tue, 20 Apr 2010 18:52:43 +0000
parents ef996982334c
children 85709f0b589c
files src/cache.c
diffstat 1 files changed, 5 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/cache.c	Tue Apr 20 16:04:24 2010 +0000
+++ b/src/cache.c	Tue Apr 20 18:52:43 2010 +0000
@@ -936,20 +936,16 @@
            URL_STR_(entry->Url), URL_STR_(entry->Location));
       _MSG("%s", entry->Header->str);
 
-      if (Flags & WEB_RootUrl) {
-         /* Redirection of the main page */
+      if ((Flags & WEB_RootUrl) ||
+          (prefs.filter_auto_requests == PREFS_FILTER_SAME_DOMAIN)) {
+         /* Follow redirection for the main page unconditionally. For images
+          * and stylesheets, follow if the request will go through filtering.
+          */
          NewUrl = a_Url_new(URL_STR_(entry->Location), URL_STR_(entry->Url));
          if (entry->Flags & CA_TempRedirect)
             a_Url_set_flags(NewUrl, URL_FLAGS(NewUrl) | URL_E2EQuery);
          a_Nav_push(bw, NewUrl, entry->Url);
          a_Url_free(NewUrl);
-      } else {
-         /* Sub entity redirection (most probably an image) */
-         if (!entry->Data->len) {
-            _MSG(">>>Image redirection without entity-content<<<\n");
-         } else {
-            _MSG(">>>Image redirection with entity-content<<<\n");
-         }
       }
    }
    return 0;