forked from NuGet/NuGet.Client
-
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.
(NuGet#9) Allow explicit proxy override
Allow passing a specific proxy into the proxy cache that is used no matter what. Based on these commits: chocolatey/nuget-chocolatey@4b206ed chocolatey/nuget-chocolatey@26559a4 Co-Authored-By: Rob Reynolds <[email protected]> Co-Authored-By: Jakub Cisło <[email protected]>
- Loading branch information
Showing
3 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
src/NuGet.Core/NuGet.Configuration/Proxy/ChocolateyProxyCache.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,29 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
////////////////////////////////////////////////////////// | ||
// Chocolatey Specific Modification | ||
////////////////////////////////////////////////////////// | ||
|
||
using System.Net; | ||
|
||
namespace NuGet.Configuration | ||
{ | ||
public partial class ProxyCache : IProxyCache, IProxyCredentialCache | ||
{ | ||
private IWebProxy _overrideProxy; | ||
private bool _isProxyOverridden = false; | ||
|
||
public void Override(IWebProxy proxy) | ||
{ | ||
_overrideProxy = proxy; | ||
_isProxyOverridden = true; | ||
} | ||
|
||
public void ClearOverriding() | ||
{ | ||
_overrideProxy = null; | ||
_isProxyOverridden = false; | ||
} | ||
} | ||
} |
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