-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle redirects in the pipeline #22876
Conversation
return new SocketsHttpHandler(); | ||
return new SocketsHttpHandler() | ||
{ | ||
AllowAutoRedirect = false | ||
}; | ||
#else | ||
return new HttpClientHandler(); | ||
return new HttpClientHandler() | ||
{ | ||
AllowAutoRedirect = false | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
#if NETCOREAPP
return new SocketsHttpHandler()
#else
return new HttpClientHandler();
#endif
{
AllowAutoRedirect = false
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's evil :)
// Clear the authorization header. | ||
request.Headers.Remove(HttpHeader.Names.Authorization); | ||
|
||
if (AzureCoreEventSource.Singleton.IsEnabled()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious why we don't do these checks in the eventSource instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid converting Uris to strings if the ES is disabled.
After this update, I assume I should remove my changes in Communications, correct? |
Correct. You would also need to add a ProjectReference to Azure.Core (to get the new feature) and flip it back to PackageReference when Azure.Core ships with the fix. |
Can we just wait for the package? |
That works too! |
Co-authored-by: Christopher Scott <chriscott@hotmail.com>
response.Dispose(); | ||
|
||
// Clear the authorization header. | ||
request.Headers.Remove(HttpHeader.Names.Authorization); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dotnet/runtime#26475 (comment)
TLDR to prevent accidental secret leaks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
Fixes: #22746