mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-22 23:59:46 -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,13 +40,17 @@ function Read-IcingaRESTMessage()
|
|||
$ArgumentsSplit = $Arguments.Split('&');
|
||||
$ArgumentsSplit+='\\\\\\\\\\\\=FIN';
|
||||
foreach ( $Argument in $ArgumentsSplit | Sort-Object -descending) {
|
||||
$Argument -match '(.+)=(.+)' | Out-Null;
|
||||
If (($Matches[1] -ne $Current) -And ($NULL -ne $Current)) {
|
||||
$Request.RequestArguments.Add( $Current, $ArgumentContent );
|
||||
[array]$ArgumentContent = $null;
|
||||
if ($Argument.Contains('=')) {
|
||||
$Argument -match '(.+)=(.+)' | Out-Null;
|
||||
If (($Matches[1] -ne $Current) -And ($NULL -ne $Current)) {
|
||||
$Request.RequestArguments.Add( $Current, $ArgumentContent );
|
||||
[array]$ArgumentContent = $null;
|
||||
}
|
||||
$Current = $Matches[1];
|
||||
[array]$ArgumentContent += ($Matches[2]);
|
||||
} else {
|
||||
$Request.RequestArguments.Add( $Argument, $null );
|
||||
}
|
||||
$Current = $Matches[1];
|
||||
[array]$ArgumentContent += ($Matches[2]);
|
||||
}
|
||||
|
||||
# Header
|
||||
|
|
|
|||
Loading…
Reference in a new issue