mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-23 08:10:16 -05:00
Adds support for API arguments without value
This commit is contained in:
parent
0081641bd6
commit
9a2f3cd429
1 changed files with 10 additions and 6 deletions
|
|
@ -40,6 +40,7 @@ function Read-IcingaRESTMessage()
|
||||||
$ArgumentsSplit = $Arguments.Split('&');
|
$ArgumentsSplit = $Arguments.Split('&');
|
||||||
$ArgumentsSplit+='\\\\\\\\\\\\=FIN';
|
$ArgumentsSplit+='\\\\\\\\\\\\=FIN';
|
||||||
foreach ( $Argument in $ArgumentsSplit | Sort-Object -descending) {
|
foreach ( $Argument in $ArgumentsSplit | Sort-Object -descending) {
|
||||||
|
if ($Argument.Contains('=')) {
|
||||||
$Argument -match '(.+)=(.+)' | Out-Null;
|
$Argument -match '(.+)=(.+)' | Out-Null;
|
||||||
If (($Matches[1] -ne $Current) -And ($NULL -ne $Current)) {
|
If (($Matches[1] -ne $Current) -And ($NULL -ne $Current)) {
|
||||||
$Request.RequestArguments.Add( $Current, $ArgumentContent );
|
$Request.RequestArguments.Add( $Current, $ArgumentContent );
|
||||||
|
|
@ -47,6 +48,9 @@ function Read-IcingaRESTMessage()
|
||||||
}
|
}
|
||||||
$Current = $Matches[1];
|
$Current = $Matches[1];
|
||||||
[array]$ArgumentContent += ($Matches[2]);
|
[array]$ArgumentContent += ($Matches[2]);
|
||||||
|
} else {
|
||||||
|
$Request.RequestArguments.Add( $Argument, $null );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Header
|
# Header
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue