aboutsummaryrefslogtreecommitdiff
path: root/src/cache.c
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2015-01-02 00:39:21 +0100
committerSebastian Geerken <devnull@localhost>2015-01-02 00:39:21 +0100
commit974f88a4adc3ef460ad00ba3d398f697c8812393 (patch)
tree55c88aad376ae3d6a0a2f714c9f55673d9d989ef /src/cache.c
parentecb8be82abafc3c7580cdeed4c8902b44bd06ae5 (diff)
parent86e780e73a11e8b9d1d57cb5f283c4fee6ca68e8 (diff)
Merge with main repo.
Diffstat (limited to 'src/cache.c')
-rw-r--r--src/cache.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/cache.c b/src/cache.c
index ee424c58..189e18d5 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -1001,14 +1001,20 @@ static int Cache_redirect(CacheEntry_t *entry, int Flags, BrowserWindow *bw)
_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;
if (entry->Flags & CA_RedirectLoop) {
- a_UIcmd_set_msg(bw, "ERROR: redirect loop for: %s", URL_STR_(entry->Url));
- bw->redirect_level = 0;
- return 0;
+ a_UIcmd_set_msg(bw, "ERROR: redirect loop for: %s", URL_STR_(entry->Url));
+ bw->redirect_level = 0;
+ return 0;
}
if ((entry->Flags & CA_Redirect && entry->Location) &&