http decorators incorrectly handled when authentication is used
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Confirmed
|
Low
|
Vincent Ladeuil | ||
Breezy |
Fix Released
|
Low
|
Jelmer Vernooij |
Bug Description
bzr use urlparse.urlsplit or urlparse.urlparse (which calls urlsplit) to extract scheme, host, path etc from the url
urlparse.urlsplit fails to recognize http+urllib or http+pycurl as valid schemes and returns an empty netloc (user + password + host + port).
As the netloc is prepended to the returned path and bzr concatenate both when needed, this has not been noticed until now.
While no authentication is used, there is no consequences, but failing to extract the user and password from the netloc causes problems when authentication is needed.
But again, this occurs only when a user needs to use an http implementation explicitly, if the user relies on the default implementation by using no decorators, all is fine.
It's arguably a python bug but we have to deal with it.
Related branches
- Martin Packman: Approve
-
Diff: 991 lines (+20/-691)9 files modifiedbreezy/tests/features.py (+0/-1)
breezy/tests/http_server.py (+0/-22)
breezy/tests/https_server.py (+0/-14)
breezy/tests/test_bzrdir.py (+0/-12)
breezy/tests/test_http.py (+11/-169)
breezy/transport/__init__.py (+4/-18)
breezy/transport/http/__init__.py (+1/-1)
breezy/transport/http/_pycurl.py (+0/-454)
doc/en/release-notes/brz-3.0.txt (+4/-0)
Changed in bzr: | |
assignee: | nobody → v-ladeuil |
importance: | Undecided → Low |
status: | New → Confirmed |
Changed in brz: | |
status: | New → Triaged |
importance: | Undecided → Low |
milestone: | none → 3.0.0 |
Changed in brz: | |
status: | Triaged → Fix Released |
assignee: | nobody → Jelmer Vernooij (jelmer) |
I think a simple "bzrlib. transport. register_ urlparse_ netloc_ protocol( 'http+urllib' )" et al will suffice (you need +urllib and +pycurl as well as https).
And then some tests that "get_transport( https+pycurl: //user@ host... )" is properly parsed for the different variants.