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:
		| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user