Opened 4 years ago
Last modified 4 years ago
#32537 closed New feature
RequestSite and IDN — at Version 1
Reported by: | François Poulain | Owned by: | nobody |
---|---|---|---|
Component: | contrib.sites | Version: | 3.1 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
Without using django.contrib.sites, get_current_site reply a RequestSite instance defining name and domain.
On a IDN setup, we are currently getting Punicode in the name due to the init sequence:
def __init__(self, request): self.domain = self.name = request.get_host()
IMHO a punicode version of the domain in not what I expect in the name
attribute.
I suggest that if any part of the domains starts with xn--
it should be tried to set the name by decoding the domain from idna.
How do you think about it? (I may provide patch if you agree on the behavior)