Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Url encoding of vhost #37

Open
romainjanvier opened this issue May 22, 2018 · 1 comment
Open

Url encoding of vhost #37

romainjanvier opened this issue May 22, 2018 · 1 comment

Comments

@romainjanvier
Copy link
Contributor

I met an issue with the command to create queues. I have two vhosts in my application : / and /module. Then I made the configuration file with these two vhosts, here a sample :

/:
    exchanges:
        direct:
            type: direct
            durable: true
    queues:
        jobs_image:
            durable: true
            bindings:
                -
                    exchange: direct
                    routing_key: jobs_image

/module:
    exchanges:
        direct:
            type: direct
            durable: true
    queues:
        jobs_image:
            durable: true
            bindings:
                -
                    exchange: direct
                    routing_key: jobs_image

I realized the command is not able to manage 2 vhosts in the same file (unfortunately...), anyway, I split this configuration into two files.

But the execution of the queues creation command with the vhost /module didn't work because of the leading slash. I was able to make work the command naming vhost %2fmodule. But there is no need to url rewrite the default vhost thanks to this code : https://github.com/odolbeau/rabbit-mq-admin-toolkit/blob/master/src/Bab/RabbitMq/VhostManager.php#L21

Although leading slash is not required in the rabbitmq vhost name, many usage include it. So I ask why there is no url rewriting on every vhost name or is it intentional as the code seems to mean ?

Thanks for your great shared work.

@odolbeau
Copy link
Owner

Hi.

You don't need to put it in your configuration file nor in the command name (you can use directly module in your example).
Anyway, you're right, we could definitively transform / remove the leading slash when we found one. This will allow everyone to use either a slash, %2f or nothing. Of course, don't hesitate to create a PR if you want. :)

romainjanvier added a commit to romainjanvier/rabbit-mq-admin-toolkit that referenced this issue Jun 21, 2018
romainjanvier added a commit to romainjanvier/rabbit-mq-admin-toolkit that referenced this issue Jul 5, 2018
odolbeau pushed a commit that referenced this issue Jul 5, 2018
* Allow slash in vhost name #37

* Fix lowercase in vhost slash encoding #37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants