diff --git a/lib/web/Get-IcingaRESTHeaderValue.psm1 b/lib/web/Get-IcingaRESTHeaderValue.psm1 new file mode 100644 index 0000000..4eb9caa --- /dev/null +++ b/lib/web/Get-IcingaRESTHeaderValue.psm1 @@ -0,0 +1,17 @@ +function Get-IcingaRESTHeaderValue() +{ + param( + [hashtable]$Request = @{}, + [string]$Header = $null + ); + + if ($null -eq $Request -or [string]::IsNullOrEmpty($Header) -Or $Request.Count -eq 0) { + return $null; + } + + if ($Request.Header.ContainsKey($Header) -eq $FALSE) { + return $null + } + + return $Request.Header[$Header]; +}