forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Internal Http SystemProxyInfo object should never be null (dotnet/cor…
…efx#37306) In order to provide a consistent experience with the HttpClient IWebProxy objects, the returned internal proxy object which represent the system/platform proxy settings should never be null. If the platform's settings indicate that no proxy is being used, then return an instance of the internal HttpNoProxy object. Note that even if the platform settings indicate that a proxy could be used, any particular Http request might still not go thru a proxy. The final determination of what proxy is being used for a request is still governed by the return of the IWebProxy.IsBypassed and IWebProxy.GetProxy methods. Contributes to dotnet/corefx#36553 Commit migrated from dotnet/corefx@830bf7f
- Loading branch information
Showing
6 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpNoProxy.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
namespace System.Net.Http | ||
{ | ||
internal sealed class HttpNoProxy : IWebProxy | ||
{ | ||
public ICredentials Credentials { get; set; } | ||
public Uri GetProxy(Uri destination) => null; | ||
public bool IsBypassed(Uri host) => true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters