Preserve WebSession.MaximumRedirection from changes#19190
Preserve WebSession.MaximumRedirection from changes#19190iSazonov merged 25 commits intoPowerShell:masterfrom
Conversation
test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1
Show resolved
Hide resolved
|
@CarloToso I suggest don't modify existing test and add new one - create |
|
@CarloToso Please update the PR title and description. |
...t.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1
Outdated
Show resolved
Hide resolved
…Cmdlet/Common/WebRequestPSCmdlet.Common.cs Co-authored-by: Ilya <[email protected]>
test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1
Outdated
Show resolved
Hide resolved
|
|
||
| $session = [Microsoft.PowerShell.Commands.WebRequestSession]::new() | ||
| $session.Proxy = [System.Net.WebProxy]::new($proxy) | ||
| $null = Invoke-WebRequest -Uri http://httpbin.org -PreserveAuthorizationOnRedirect -WebSession $session -Headers $headers |
There was a problem hiding this comment.
We shouldn't use external server for tests.
There was a problem hiding this comment.
The same was done in line 2419 with this comment:
# use external url, but with proxy the external url should not actually be called
There was a problem hiding this comment.
If possible it must be replaced with our helper.
|
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
|
🎉 Handy links: |
PR Summary
The WebSession.MaximumRedirection parameter shouldn't change as we handle redirections.
This bug appears in edge cases when we use -WebSession -AllowInsecureRedirect -MaximumRedirection together.
Add some tests to check that WebSession doesn't change during usage
PR Context
Fix #19183
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.(which runs in a different PS Host).