GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Clear session authorization headers on redirect retries by jshigetomi · Pull Request #28398 · PowerShell/PowerShell Conversation
|
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Redirect handling permanently removes Authorization from a caller-supplied web session, breaking later requests that reuse it, and regression coverage for redirected retries is missing.
This PR hardens redirect retries in the shared web cmdlet implementation by preventing reuse of session-level authorization unless explicitly preserved.
Changes:
-PreserveAuthorizationOnRedirect is disabled.| File | Description |
|---|---|
| src/Microsoft.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs | Extends redirect authorization cleanup to session headers used when rebuilding requests for retries. |
Review effort: Balanced
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if (isRedirect && !PreserveAuthorizationOnRedirect && request.Headers.Contains(HttpKnownHeaderNames.Authorization)) | ||
| if (isRedirect && !PreserveAuthorizationOnRedirect) | ||
| { | ||
| WebSession?.Headers?.Remove(HttpKnownHeaderNames.Authorization); |
| if (isRedirect && !PreserveAuthorizationOnRedirect && request.Headers.Contains(HttpKnownHeaderNames.Authorization)) | ||
| if (isRedirect && !PreserveAuthorizationOnRedirect) | ||
| { | ||
| WebSession?.Headers?.Remove(HttpKnownHeaderNames.Authorization); |
|
Patrick Meinecke (@SeeminglyScience) can you please take a look at the Copilot comments? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
At least 1 approving review is required to merge this pull request.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.