Skip to content

Commit 22e3cae

Browse files
authored
Improve note on HttpClientHandler.AllowAutoRedirect (#11110)
- Turn around the paragraph, emphasizing the modern behavior - Harmonize language on .NET Core / .NET 5+ with the rest of HttpClient docs
1 parent 8e5ebea commit 22e3cae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

xml/System.Net.Http/HttpClientHandler.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@
138138
If you are using cookies by specifically adding them to the <xref:System.Net.Http.HttpRequestMessage.Headers> collection, these are not cleared when a redirect is followed, as the handler has no way of knowing what domain a cookie is allowed for. If you want to mimic browser behavior, use the <xref:System.Net.CookieContainer> class which allows you to specify the target domain for a cookie.
139139
140140
> [!NOTE]
141-
> With <xref:System.Net.Http.HttpClientHandler.AllowAutoRedirect%2A> set to `true`, the .NET Framework will follow redirections even when being redirected to an HTTP URI from an HTTPS URI.
142-
.NET Core versions 1.0, 1.1 and 2.0 will not follow a redirection from HTTPS to HTTP even if <xref:System.Net.Http.HttpClientHandler.AllowAutoRedirect%2A> is set to `true`.
141+
> On .NET Core and .NET 5 and later versions, setting <xref:System.Net.Http.HttpClientHandler.AllowAutoRedirect> to `true` **does not enable** automatic redirection to an HTTP URI from an HTTPS URI.
142+
> Such (secure to insecure) redirections are only followed on .NET Framework.
143143
144144
]]></format>
145145
</remarks>

0 commit comments

Comments
 (0)