Skip to content
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

Make host lowercasing consistent #70

Closed
nvie opened this issue Apr 28, 2016 · 2 comments
Closed

Make host lowercasing consistent #70

nvie opened this issue Apr 28, 2016 · 2 comments

Comments

@nvie
Copy link

nvie commented Apr 28, 2016

There's a minor discrepancy in how the hostname is lowercased, based on which API you use.

Steps to replicate

This seems OK:

>>> url = furl('https://MyHostWithCaps.example.org')
>>> url.host
'myhostwithcaps.example.org'
>>> str(url)
'https://myhostwithcaps.example.org'

This seems not OK (or at least not consistent):

>>> url = furl('https://MyHostWithCaps.example.org')
>>> url.host = 'MyHostWithCaps.example.org'             # <- difference here!
>>> url.host
'MyHostWithCaps.example.org'
>>> str(url)
'https://MyHostWithCaps.example.org'
Expected result

The u.host property should always return a lowercased value.

Actual result

The u.host property can sometimes return a string with non-lowercase chars.

@nvie nvie changed the title Make host setting consistent Make host lowercasing consistent Apr 28, 2016
@gruns
Copy link
Owner

gruns commented May 19, 2016

Wonderful catch.

Fixed in furl v0.4.95.

>>> import furl
>>> furl.__version__
'0.4.95'
>>> from furl import furl
>>> f = furl('https://MyHostWithCaps.example.org')
>>> f.url
'https://myhostwithcaps.example.org'
>>> f.host = 'MyHostWithCaps.example.org'
>>> f.url
'https://myhostwithcaps.example.org'

Upgrade with pip install furl -U.

Thank you for the thorough, detailed Issue and bringing this bug to my
attention, Vincent. Don't hesitate to let me know if there's anything else I can
do for you.

@gruns gruns closed this as completed May 19, 2016
@nvie
Copy link
Author

nvie commented May 19, 2016

Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants