remove double slashes from $uri

master
lub 5 years ago
parent 02a8021a4e
commit a5d2c276eb

@ -1,5 +1,5 @@
#alternatively read params from $env #alternatively read params from $env
#for more flexible Dockerifle support #for more flexible Dockerfile support
param ( param (
[ValidateNotNullOrEmpty()] [ValidateNotNullOrEmpty()]
[uri] [uri]
@ -40,7 +40,7 @@ function Send-MatrixEvent {
#txn_id should be unique per client, so we use timestamp+random #txn_id should be unique per client, so we use timestamp+random
$txn_id = '{0}{1}' -f (Get-Date -UFormat '%s'),(Get-Random) $txn_id = '{0}{1}' -f (Get-Date -UFormat '%s'),(Get-Random)
$uri = '{0}/_matrix/client/r0/rooms/{1}/send/{2}/{3}' -f $HomeServer,$RoomId,$EventType,$txn_id $uri = '{0}_matrix/client/r0/rooms/{1}/send/{2}/{3}' -f $HomeServer,$RoomId,$EventType,$txn_id
$header_splat = @{ $header_splat = @{
Authentication = 'Bearer' Authentication = 'Bearer'
@ -211,7 +211,7 @@ function Join-MatrixRoom {
$RoomId $RoomId
) )
$uri = '{0}/_matrix/client/r0/rooms/{1}/join' -f $HomeServer,$RoomId $uri = '{0}_matrix/client/r0/rooms/{1}/join' -f $HomeServer,$RoomId
$header_splat = @{ $header_splat = @{
Authentication = 'Bearer' Authentication = 'Bearer'
@ -237,7 +237,7 @@ function Get-MatrixAccountData {
$Type $Type
) )
$uri = '{0}/_matrix/client/r0/user/{1}/account_data/{2}' -f $HomeServer,$UserId,$Type $uri = '{0}_matrix/client/r0/user/{1}/account_data/{2}' -f $HomeServer,$UserId,$Type
$header_splat = @{ $header_splat = @{
Authentication = 'Bearer' Authentication = 'Bearer'
@ -263,7 +263,7 @@ function Set-MatrixAccountData {
$Content $Content
) )
$uri = '{0}/_matrix/client/r0/user/{1}/account_data/{2}' -f $HomeServer,$UserId,$Type $uri = '{0}_matrix/client/r0/user/{1}/account_data/{2}' -f $HomeServer,$UserId,$Type
$header_splat = @{ $header_splat = @{
Authentication = 'Bearer' Authentication = 'Bearer'
@ -303,7 +303,7 @@ function Invoke-MatrixSync {
$Timeout = 30000 $Timeout = 30000
) )
$uri = '{0}/_matrix/client/r0/sync?timeout={1}' -f $HomeServer,$Timeout $uri = '{0}_matrix/client/r0/sync?timeout={1}' -f $HomeServer,$Timeout
if($Token) { if($Token) {
$uri += '&since={0}' -f $Token $uri += '&since={0}' -f $Token
} }
@ -348,7 +348,7 @@ function Get-MatrixFilterId {
$Filter $Filter
) )
$uri = '{0}/_matrix/client/r0/user/{1}/filter' -f $HomeServer,$UserId $uri = '{0}_matrix/client/r0/user/{1}/filter' -f $HomeServer,$UserId
$header_splat = @{ $header_splat = @{
Authentication = 'Bearer' Authentication = 'Bearer'

Loading…
Cancel
Save