mirror of https://github.com/celery/kombu.git
parse_url removed more than one leading slash. Closes #121
This commit is contained in:
parent
83759b3e4b
commit
0c7d822af0
|
@ -320,7 +320,7 @@ class Channel(virtual.Channel):
|
|||
raise ValueError(
|
||||
"Database name must be int between 0 and limit - 1")
|
||||
|
||||
return self.Client(host=conninfo.hostname,
|
||||
return self.Client(host=conninfo.hostname or "127.0.0.1",
|
||||
port=conninfo.port or DEFAULT_PORT,
|
||||
db=database,
|
||||
password=conninfo.password)
|
||||
|
|
|
@ -20,7 +20,8 @@ def _parse_url(url):
|
|||
# This enables the use of replica sets and sharding.
|
||||
# See pymongo.Connection() for more info.
|
||||
hostname = schemeless if scheme == 'mongodb' else parts.hostname
|
||||
path = (parts.path or '').lstrip('/')
|
||||
path = parts.path or ''
|
||||
path = path[1:] if path and path[0] == '/' else path
|
||||
return (scheme, unquote(hostname or '') or None,
|
||||
int(parts.port) if parts.port else None,
|
||||
unquote(parts.username or '') or None,
|
||||
|
|
Loading…
Reference in New Issue