Allow a forward slash as a part of the user/password

quote method has a safe parameter which is set to '/' so when
the end user has a / in the rabbit_password then we end up leaving
that in the url which ends up looking like:

amqp://stackrabbit:pass/word@10.0.0.9:5672//

Which is clearly invalid, so we should set safe parameter to '' which
allows the url to be constructed properly (see transport.py
TransportURL.__str__ method works this work)

Closes-Bug: #1474933
Change-Id: I14fb54440d0925f3676e18d13182ed0fa9c34ca2
This commit is contained in:
Davanum Srinivas 2015-07-17 22:25:48 -04:00
parent 8a9b5d44ae
commit adcd0807d6

@ -452,8 +452,8 @@ class Connection(object):
adr, default_port=self.rabbit_port)
self._url += '%samqp://%s:%s@%s:%s/%s' % (
";" if self._url else '',
parse.quote(self.rabbit_userid),
parse.quote(self.rabbit_password),
parse.quote(self.rabbit_userid, ''),
parse.quote(self.rabbit_password, ''),
self._parse_url_hostname(hostname), port,
virtual_host)