-
-
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
Preserve the case of username and password in URL.build #920
Conversation
@@ -261,6 +261,12 @@ def build( | |||
elif not user and not password and not host and not port: | |||
netloc = "" | |||
else: | |||
if "@" in host and not user and not password: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a weird place to extract this data from.. Could you add more detail regarding the problem you're trying to address?
def test_build_with_case_sensitive_user_and_password(): | ||
url = URL.build(scheme='httPS', host='usER:passWORD@hostNAME', path='/paTH') | ||
assert url.user == "usER" | ||
assert url.password == "passWORD" | ||
|
||
|
||
def test_build_with_case_sensitive_user(): | ||
url = URL.build(scheme='httPS', host='usER@hostNAME', path='/paTH') | ||
assert url.user == "usER" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like these are the same test. So I'd recommend using @pytest.mark.parametrize
to fold it.
Also, I don't believe that scheme needs to be case-insensitive. Do you have any RFC reference that clarify this corner case?
@@ -0,0 +1 @@ | |||
Preserve the case of username and password in URL.build when extracted from host. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, use the past tense and RST markup here.
|
||
|
||
def test_build_with_case_sensitive_user_and_password(): | ||
url = URL.build(scheme='httPS', host='usER:passWORD@hostNAME', path='/paTH') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, why this information would ever be a part of the host? I don't think the API should allow for it at all...
This is the wrong fix, as discussed in #880. The issue is that The right fix is to reject any |
What do these changes do?
The new changes preserve casing of username and password when extracted from host in URL.build
Are there changes in behavior for the user?
No.
Related issue number
#880
Checklist
CHANGES
folder<issue_id>.<type>
(e.g.588.bugfix
)issue_id
change it to the pr id after creating the PR.feature
: Signifying a new feature..bugfix
: Signifying a bug fix..doc
: Signifying a documentation improvement..removal
: Signifying a deprecation or removal of public API..misc
: A ticket has been closed, but it is not of interest to users.Fix issue with non-ascii contents in doctest text files.