-
-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert host to lowercase on URL building #386
Comments
I recall hitting something similar in CherryPy/Cheroot. Let me check how I dealt with it. |
So according to my old research, the user can put a lot of random stuff, including Unicode range chars, as a hostname on the OS level: cherrypy/cheroot#27 (comment). I think this issue may need to be extended with that in mind. |
hostname is IDNA-encoded in yarl, so weird chars should go. |
I think the comparison should be case-insensitive but the internal representation could be stored as provided on input. |
There is no case-insensitive comparison operator is Python. |
I thought you were talking about implementing a custom |
That's why case-insensitive strings are error-prone when implemented in Python. |
That's interesting, we have tests for lowercased host for years:
I think, all that we need is lowercasing the host always. |
MacOS can return CamelCased FQDN for the local host, e.g.
Mac-1137.local
.At least I see it on Azure CI for
aiohttp
project.IIRC the name should be lower-cased.
Well, technically the upper case is supported still, the comparison rule is case-insensitive.
But lower-casing is highly recommended,
yarl
should apply this conversion.The text was updated successfully, but these errors were encountered: