1
0
mirror of https://github.com/django/django.git synced 2025-10-31 01:25:32 +00:00

Refs #32375 -- Changed default sitemap protocol to https.

Per deprecation timeline.
This commit is contained in:
Mariusz Felisiak
2023-01-06 12:55:14 +01:00
parent 602d9a312f
commit 4eb97a90f0
5 changed files with 10 additions and 34 deletions

View File

@@ -1,4 +1,3 @@
import warnings
from urllib.parse import urlencode
from urllib.request import urlopen
@@ -8,7 +7,6 @@ from django.core import paginator
from django.core.exceptions import ImproperlyConfigured
from django.urls import NoReverseMatch, reverse
from django.utils import translation
from django.utils.deprecation import RemovedInDjango50Warning
PING_URL = "https://www.google.com/webmasters/tools/ping"
@@ -133,17 +131,7 @@ class Sitemap:
def get_protocol(self, protocol=None):
# Determine protocol
if self.protocol is None and protocol is None:
warnings.warn(
"The default sitemap protocol will be changed from 'http' to "
"'https' in Django 5.0. Set Sitemap.protocol to silence this "
"warning.",
category=RemovedInDjango50Warning,
stacklevel=2,
)
# RemovedInDjango50Warning: when the deprecation ends, replace 'http'
# with 'https'.
return self.protocol or protocol or "http"
return self.protocol or protocol or "https"
def get_domain(self, site=None):
# Determine domain