Skip to content

Commit

Permalink
feat: HttpListenerRequest.get_XHR ( Fixes #1120 )
Browse files Browse the repository at this point in the history
  • Loading branch information
James Brundage committed May 4, 2024
1 parent 842e1aa commit 51321eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions Types/HttpListener/Request/Alias.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
HostHeader = 'HostName'
Subdomains = 'Subdomain'
QueryParameters = 'QueryParameter'
XHR = 'IsXmlHttpRequest'
}
8 changes: 8 additions & 0 deletions Types/HttpListener/Request/get_IsXmlHttpRequest.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<#
.SYNOPSIS
Determines if the request is an AJAX request.
.DESCRIPTION
Determines if the request was made with XmlHttpRequest.
#>
return ($this.Headers -and
($this.Headers["X-Requested-With"] -eq "XMLHttpRequest"))

0 comments on commit 51321eb

Please sign in to comment.