jemc / ruby-rabbitmq

A Ruby RabbitMQ client library based on FFI bindings for librabbitmq. :gem: :rabbit2:
MIT License
10 stars 7 forks source link

Handle URLs with trailing slash correctly #8

Closed janko closed 7 years ago

janko commented 7 years ago

When I tried to connect to an AMQP URL which had a trailing slash (and no path), I got a NotImplementedError in RabbitMQ::Connection#login!. After a little digging I found out that the URLs with trailing slashes aren't correctly parsed; the vhost was extracted as "" instead of "/". When I removed the trailing slash, the connection was established just fine.

I don't know if this is supposed to be fixed in the RabbitMQ project or here, but the fix was easy.

jemc commented 7 years ago

Thanks!