From 227115551d2010a6e128ff378f3899b94b4d6629 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Thu, 11 Dec 2008 23:22:54 +0000 Subject: [PATCH] Fix detecting localhost connection --- deluge/ui/client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/deluge/ui/client.py b/deluge/ui/client.py index 3cb2eac2f..2b299444d 100644 --- a/deluge/ui/client.py +++ b/deluge/ui/client.py @@ -28,6 +28,7 @@ import os.path import socket import struct import httplib +import urlparse import gobject @@ -297,8 +298,8 @@ class BaseClient(object): uri = self.core.get_core_uri() if uri != None: # Get the host - host = uri[7:].split(":")[0] - if host == "localhost" or host == "127.0.0.1": + u = urlparse.urlsplit(uri) + if u.hostname == "localhost" or u.hostname == "127.0.0.1": return True return False