From 15247507d448a7af92c09022947df33bcc4cf83c Mon Sep 17 00:00:00 2001 From: John Garland Date: Thu, 6 May 2010 23:27:04 +1000 Subject: [PATCH] Fix relative redirecting in blocklist plugin --- ChangeLog | 1 + deluge/plugins/blocklist/blocklist/core.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index cd3a2a1dc..920b74300 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,7 @@ ==== Blocklist ==== * Implement local blocklist support * #861: Pause transfers until blocklist is imported + * Fix redirection not working with relative paths ==== Execute ==== * Fix running commands with the TorrentAdded event diff --git a/deluge/plugins/blocklist/blocklist/core.py b/deluge/plugins/blocklist/blocklist/core.py index db9306910..f564b63af 100644 --- a/deluge/plugins/blocklist/blocklist/core.py +++ b/deluge/plugins/blocklist/blocklist/core.py @@ -38,6 +38,7 @@ import os import time from datetime import datetime, timedelta from wsgiref.handlers import format_date_time +from urlparse import urljoin import shutil from twisted.internet.task import LoopingCall @@ -281,7 +282,7 @@ class Core(CorePluginBase): d = f if f.check(error.PageRedirect): # Handle redirect errors - location = error_msg.split(" to ")[1] + location = urljoin(self.config["url"], error_msg.split(" to ")[1]) if "Moved Permanently" in error_msg: log.debug("Setting blocklist url to %s", location) self.config["url"] = location