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

Get-RabbitMQQueue Queuename doesn't allow space #44

Open
mooock opened this issue Mar 7, 2019 · 1 comment
Open

Get-RabbitMQQueue Queuename doesn't allow space #44

mooock opened this issue Mar 7, 2019 · 1 comment

Comments

@mooock
Copy link

mooock commented Mar 7, 2019

when using something like this

$Queue = 'Subscription for 2fc8e48a-0a10-40dd-aeb9-a2f552136243e5#8'
Get-RabbitMQMessage -VirtualHost $VirtualHost -Name $Queue -Count 1 -Credential $RMQCRED -BaseUri $RMQURI -Encoding auto -View Default

i receive this
Invoke-RestMethod : {"error":"not_found","reason":"NOT_FOUND - no queue 'Subscription+for+2fc8e48a-0a10-40dd-aeb9-a2f552136243e5#8' in vhost 'RMQ_TEST'"}
At line:131 char:13

it looks like the + sign is translated

@mooock
Copy link
Author

mooock commented Mar 7, 2019

Found the issue in

$url = Join-Parts $BaseUri "/api/queues/$([System.Web.HttpUtility]::UrlEncode($VirtualHost))/$([uri]::EscapeDataString("$Name"))/get"

instead of using the .Net class [System.Web.HttpUtility]::UrlEncode
use [uri]::EscapeDataString for translating it a space to %20 and not +

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

1 participant