From: Michael Tremer Date: Thu, 12 Oct 2017 10:28:42 +0000 (+0200) Subject: Move planet to HTTPS X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4da2cb99eee4082a19dee72b5e27df6f3d9cf1cf;p=ipfire.org.git Move planet to HTTPS Signed-off-by: Michael Tremer --- diff --git a/webapp/backend/accounts.py b/webapp/backend/accounts.py index eb30e2b3..c7b943a1 100644 --- a/webapp/backend/accounts.py +++ b/webapp/backend/accounts.py @@ -307,7 +307,7 @@ class Account(Object): else: hostname = "accounts.ipfire.org" - url = "http://%s/avatar/%s.jpg" % (hostname, self.uid) + url = "https://%s/avatar/%s.jpg" % (hostname, self.uid) if size: url += "?size=%s" % size @@ -351,7 +351,7 @@ class Account(Object): gravatar_email = "nobody@ipfire.org" # construct the url - gravatar_url = "http://www.gravatar.com/avatar/" + \ + gravatar_url = "https://www.gravatar.com/avatar/" + \ hashlib.md5(gravatar_email).hexdigest() + "?" gravatar_url += urllib.urlencode({'d': "mm", 's': str(size)}) diff --git a/webapp/backend/planet.py b/webapp/backend/planet.py index 7f69b51c..c6b35825 100644 --- a/webapp/backend/planet.py +++ b/webapp/backend/planet.py @@ -35,7 +35,7 @@ class PlanetEntry(Object): @property def url(self): - return "http://planet.ipfire.org/post/%s" % self.slug + return "https://planet.ipfire.org/post/%s" % self.slug def set_published(self, published): if self.published == published: diff --git a/webapp/handlers_accounts.py b/webapp/handlers_accounts.py index bc419fdd..d07b936c 100644 --- a/webapp/handlers_accounts.py +++ b/webapp/handlers_accounts.py @@ -36,7 +36,7 @@ class AccountsAvatarHandler(BaseHandler): else: avatar = account.get_gravatar_url(size) - if avatar.startswith("http://"): + if avatar.startswith("http://") or avatar.startswith("https://"): return self.redirect(avatar) self.set_header("Cache-Control", "public,max-age=300")