Skip to content

Prepare URL coerces to lower-case #5886

Description

@dmitrypolo

scheme, auth, host, port, path, query, fragment = parse_url(url)

When passing in a URL with an upper-case letter after a - character the host is coerced to lower case.

Python Version: 3.9.1
Requests Version: 2.26.0
OS: MacOS

Steps to reproduce

from requests.models import PreparedRequest
p = PreparedRequest()
url = "http://service-A/abc"

p.prepare_url(url, None)
print(p.url)
"http://service-a/abc"

Notice how the A has been changed to a. This behavior is not expected. I have also submitted this bug report as the behavior arises from the use of urllib3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions