From c4556c0f8e0d5b5b9965fb10659a68ef4f156e34 Mon Sep 17 00:00:00 2001 From: Sophist Date: Tue, 9 Dec 2014 09:22:40 +0000 Subject: [PATCH] Tweak url formatting See http://forums.musicbrainz.org/viewtopic.php?id=5394 for original issue (with discogs) and proposed fix. This tweak goes slightly beyond this, only providing a specific port if it is not 80 or 443. --- picard/webservice.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/picard/webservice.py b/picard/webservice.py index aab058d60..a580cab37 100644 --- a/picard/webservice.py +++ b/picard/webservice.py @@ -180,8 +180,10 @@ class XmlWebService(QtCore.QObject): def _start_request_continue(self, method, host, port, path, data, handler, xml, mblogin=False, cacheloadcontrol=None, refresh=None, access_token=None): - if mblogin and host in MUSICBRAINZ_SERVERS and port == 80: + if (mblogin and host in MUSICBRAINZ_SERVERS and port == 80) or port == 443: urlstring = "https://%s%s" % (host, path) + elif port is None or port == 80: + urlstring = "http://%s%s" % (host, path) else: urlstring = "http://%s:%d%s" % (host, port, path) log.debug("%s %s", method, urlstring)