AV-98-fork

A fork of https://tildegit.org/solderpunk/AV-98
Log (Feed) | Files | Refs (Tags) | README | LICENSE

commit 8945fa4f7e13cf6f3f3499de8c7ec02315326efc
parent 7a3f1c77a58d541b931e8155c12a53d57372a667
Author: Solderpunk <solderpunk@sdf.org>
Date:   Sat, 23 May 2020 12:53:20 +0200

Don't follow cross-domain redirects automatically.

Diffstat:
Mav98.py | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/av98.py b/av98.py @@ -413,6 +413,11 @@ Slow internet connection? Use 'set timeout' to be more patient.""") print("Error: caught in redirect loop!") elif len(self.previous_redirectors) == _MAX_REDIRECTS: print("Error: refusing to follow more than %d consecutive redirects!" % _MAX_REDIRECTS) + # Never follow cross-domain redirects without asking + elif new_gi.host != gi.host: + follow = input("Follow cross-domain redirect to %s? (y/n) " % new_gi.url) + if follow.strip().lower() not in ("y", "yes"): + return elif not self.options["auto_follow_redirects"]: follow = input("Follow redirect to %s? (y/n) " % new_gi.url) if follow.strip().lower() not in ("y", "yes"):