arobson / rabbot

Deprecated: Please see https://github.com/Foo-Foo-MQ/foo-foo-mq
MIT License
277 stars 129 forks source link

Forward slash in passwords are not escaped #160

Open brainsiq opened 6 years ago

brainsiq commented 6 years ago

Rabbot is using the global escape function, which does not escape forward slashes. This prevents rabbot from connecting successfully.

e.g. If the credentials are username and /password then it will attempt to connect to: amqp://username:/password@rabbitmq:5672

This should be amqp://username:%2Fpassword@rabbitmq:5672

encodeURIComponent can't be used either because that will not encode a ' which according to amqplib should be encoded (https://developer.mozilla.org/en-US/docs/Glossary/percent-encoding) so I guess it should continue to use escape but manually encode any forward slashes.