Merge pull request #386 from Sophist-UK/drunkendwarf_webservice_noport

Use https if port 443 is specified, and only provide a specific port if it is not 80 or 443.
This commit is contained in:
Laurent Monin
2014-12-11 09:12:16 +01:00

View File

@@ -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)