Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Public/Add-RabbitMQExchange.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function Add-RabbitMQExchange

foreach($n in $Name)
{
$url = Join-Parts $BaseUri "/api/exchanges/$([System.Web.HttpUtility]::UrlEncode($VirtualHost))/$([System.Web.HttpUtility]::UrlEncode($n))"
$url = Join-Parts $BaseUri "/api/exchanges/$([System.Web.HttpUtility]::UrlEncode($VirtualHost))/$([System.Uri]::EscapeDataString($n))"
Write-Verbose "Invoking REST API: $url"

$result = Invoke-RestMethod $url -Credential $Credentials -AllowEscapedDotsAndSlashes -DisableKeepAlive:$InvokeRestMethodKeepAlive -ErrorAction Continue -Method Put -ContentType "application/json" -Body $bodyJson
Expand Down
2 changes: 1 addition & 1 deletion Public/Add-RabbitMQExchangeBinding.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function Add-RabbitMQExchangeBinding
{
foreach($n in $Name)
{
$url = Join-Parts $BaseUri "/api/bindings/$([System.Web.HttpUtility]::UrlEncode($VirtualHost))/e/$([System.Web.HttpUtility]::UrlEncode($ExchangeName))/e/$([System.Web.HttpUtility]::UrlEncode($Name))"
$url = Join-Parts $BaseUri "/api/bindings/$([System.Web.HttpUtility]::UrlEncode($VirtualHost))/e/$([System.Uri]::EscapeDataString($ExchangeName))/e/$([System.Uri]::EscapeDataString($Name))"
Write-Verbose "Invoking REST API: $url"

$body = @{
Expand Down
2 changes: 1 addition & 1 deletion Public/Add-RabbitMQMessage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function Add-RabbitMQMessage
{
if ($pscmdlet.ShouldProcess("server: $BaseUri/$VirtualHost", "Publish message to exchange $ExchangeName with routing key $RoutingKey"))
{
$url = Join-Parts $BaseUri "/api/exchanges/$([System.Web.HttpUtility]::UrlEncode($VirtualHost))/$([System.Web.HttpUtility]::UrlEncode($ExchangeName))/publish"
$url = Join-Parts $BaseUri "/api/exchanges/$([System.Web.HttpUtility]::UrlEncode($VirtualHost))/$([System.Uri]::EscapeDataString($ExchangeName))/publish"
Write-Verbose "Invoking REST API: $url"

$body = @{
Expand Down
2 changes: 1 addition & 1 deletion Public/Add-RabbitMQQueue.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function Add-RabbitMQQueue
{
foreach($n in $Name)
{
$url = Join-Parts $BaseUri "/api/queues/$([System.Web.HttpUtility]::UrlEncode($VirtualHost))/$([System.Web.HttpUtility]::UrlEncode($n))"
$url = Join-Parts $BaseUri "/api/queues/$([System.Web.HttpUtility]::UrlEncode($VirtualHost))/$([System.Uri]::EscapeDataString($n))"
Write-Verbose "Invoking REST API: $url"

$body = @{}
Expand Down
2 changes: 1 addition & 1 deletion Public/Add-RabbitMQQueueBinding.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function Add-RabbitMQQueueBinding
{
foreach($n in $Name)
{
$url = Join-Parts $BaseUri "/api/bindings/$([System.Web.HttpUtility]::UrlEncode($VirtualHost))/e/$([System.Web.HttpUtility]::UrlEncode($ExchangeName))/q/$([System.Web.HttpUtility]::UrlEncode($Name))"
$url = Join-Parts $BaseUri "/api/bindings/$([System.Web.HttpUtility]::UrlEncode($VirtualHost))/e/$([System.Uri]::EscapeDataString($ExchangeName))/q/$([System.Uri]::EscapeDataString($Name))"
Write-Verbose "Invoking REST API: $url"

$body = @{
Expand Down
2 changes: 1 addition & 1 deletion Public/Clear-RabbitMQQueue.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function Clear-RabbitMQQueue
{
if ($pscmdlet.ShouldProcess("server: $BaseUri/$VirtualHost", "purge queue $Name"))
{
$url = Join-Parts $BaseUri "/api/queues/$([System.Web.HttpUtility]::UrlEncode($VirtualHost))/$([System.Web.HttpUtility]::UrlEncode($Name))/contents"
$url = Join-Parts $BaseUri "/api/queues/$([System.Web.HttpUtility]::UrlEncode($VirtualHost))/$([System.Uri]::EscapeDataString($Name))/contents"
Write-Verbose "Invoking REST API: $url"

$result = Invoke-RestMethod $url -Credential $Credentials -AllowEscapedDotsAndSlashes -DisableKeepAlive:$InvokeRestMethodKeepAlive -ErrorAction Continue -Method Delete
Expand Down
2 changes: 1 addition & 1 deletion Public/Get-RabbitMQMessage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function Get-RabbitMQMessage
if ([bool]$Remove) { $s = "Messages will be removed from the queue." } else {$s = "Messages will be requeued."}
if ($pscmdlet.ShouldProcess("server: $BaseUri/$VirtualHost", "Get $Count message(s) from queue $Name. $s"))
{
$url = Join-Parts $BaseUri "/api/queues/$([System.Web.HttpUtility]::UrlEncode($VirtualHost))/$([System.Web.HttpUtility]::UrlEncode($Name))/get"
$url = Join-Parts $BaseUri "/api/queues/$([System.Web.HttpUtility]::UrlEncode($VirtualHost))/$([System.Uri]::EscapeDataString($Name))/get"
Write-Verbose "Invoking REST API: $url"

$body = @{
Expand Down
2 changes: 1 addition & 1 deletion Public/Get-RabbitMQQueueBinding.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function Get-RabbitMQQueueBinding
{
foreach ($n in $Name)
{
$result = GetItemsFromRabbitMQApi -BaseUri $BaseUri $Credentials "queues/$([System.Web.HttpUtility]::UrlEncode($VirtualHost))/$([System.Web.HttpUtility]::UrlEncode($n))/bindings"
$result = GetItemsFromRabbitMQApi -BaseUri $BaseUri $Credentials "queues/$([System.Web.HttpUtility]::UrlEncode($VirtualHost))/$([System.Uri]::EscapeDataString($n))/bindings"

$result | Add-Member -NotePropertyName "HostName" -NotePropertyValue $BaseUri

Expand Down
2 changes: 1 addition & 1 deletion Public/Remove-RabbitMQExchange.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function Remove-RabbitMQExchange
{
foreach($n in $Name)
{
$url = Join-Parts $BaseUri "/api/exchanges/$([System.Web.HttpUtility]::UrlEncode($VirtualHost))/$([System.Web.HttpUtility]::UrlEncode($n))"
$url = Join-Parts $BaseUri "/api/exchanges/$([System.Web.HttpUtility]::UrlEncode($VirtualHost))/$([System.Uri]::EscapeDataString($n))"

$result = Invoke-RestMethod $url -Credential $Credentials -AllowEscapedDotsAndSlashes -DisableKeepAlive:$InvokeRestMethodKeepAlive -ErrorAction Continue -Method Delete

Expand Down
2 changes: 1 addition & 1 deletion Public/Remove-RabbitMQQueue.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function Remove-RabbitMQQueue
{
foreach($n in $Name)
{
$url = Join-Parts $BaseUri "/api/queues/$([System.Web.HttpUtility]::UrlEncode($VirtualHost))/$([System.Web.HttpUtility]::UrlEncode($n))"
$url = Join-Parts $BaseUri "/api/queues/$([System.Web.HttpUtility]::UrlEncode($VirtualHost))/$([System.Uri]::EscapeDataString($n))"
Write-Verbose "Invoking REST API: $url"

$result = Invoke-RestMethod $url -Credential $Credentials -AllowEscapedDotsAndSlashes -DisableKeepAlive:$InvokeRestMethodKeepAlive -ErrorAction Continue -Method Delete
Expand Down