Skip to content

Commit

Permalink
Username and password should be urlencoded
Browse files Browse the repository at this point in the history
  • Loading branch information
ricbra committed Jan 13, 2015
1 parent 6925ccd commit 496e563
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions consumer/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/ricbra/rabbitmq-cli-consumer/config"
"github.com/streadway/amqp"
"log"
"net/url"
)

type Consumer struct {
Expand Down Expand Up @@ -57,8 +58,8 @@ func (c *Consumer) Consume() {
func New(cfg *config.Config, factory *command.CommandFactory, errLogger, infLogger *log.Logger) (*Consumer, error) {
uri := fmt.Sprintf(
"amqp://%s:%s@%s:%s%s",
cfg.RabbitMq.Username,
cfg.RabbitMq.Password,
url.QueryEscape(cfg.RabbitMq.Username),
url.QueryEscape(cfg.RabbitMq.Password),
cfg.RabbitMq.Host,
cfg.RabbitMq.Port,
cfg.RabbitMq.Vhost,
Expand Down

0 comments on commit 496e563

Please sign in to comment.