You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It "Validates Invoke-WebRequest with -PreserveAuthorizationOnRedirect preserves the authorization header on redirect: <redirectType> <redirectedMethod>"-TestCases $redirectTests {
# ensure user-agent is present (i.e., no false positives )
786
-
$response.Content.Headers-contains"User-Agent"| Should Be $true
784
+
$response.Content.Headers."User-Agent"| Should Not BeNullOrEmpty
787
785
# ensure Authorization header has been removed.
788
-
$response.Content.Headers-contains"Authorization"| Should Be $false
786
+
$response.Content.Headers."Authorization"| Should BeNullOrEmpty
789
787
}
790
788
791
789
# NOTE: Only testing redirection of POST -> GET for unique underlying values of HttpStatusCode.
792
790
# Some names overlap in underlying value.
793
791
It "Validates Invoke-WebRequest strips the authorization header redirects and switches from POST to GET when it handles the redirect: <redirectType> <redirectedMethod>"-TestCases $redirectTests {
It "Validates Invoke-RestMethod with -PreserveAuthorizationOnRedirect preserves the authorization header on redirect: <redirectType> <redirectedMethod>"-TestCases $redirectTests {
# ensure user-agent is present (i.e., no false positives )
1781
-
$response.Output.Headers-contains"User-Agent"| Should Be $true
1779
+
$response.Content.Headers."User-Agent"| Should Not BeNullOrEmpty
1782
1780
# ensure Authorization header has been removed.
1783
-
$response.Content.Headers-contains"Authorization"| Should Be $false
1781
+
$response.Content.Headers."Authorization"| Should BeNullOrEmpty
1784
1782
}
1785
1783
1786
1784
# NOTE: Only testing redirection of POST -> GET for unique underlying values of HttpStatusCode.
1787
1785
# Some names overlap in underlying value.
1788
1786
It "Validates Invoke-RestMethod strips the authorization header redirects and switches from POST to GET when it handles the redirect: <redirectType> <redirectedMethod>"-TestCases $redirectTests {
0 commit comments