Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

add back parsing for simple configuration #31314

Merged
merged 3 commits into from Jul 24, 2018
Merged

Conversation

wfurt
Copy link
Member

@wfurt wfurt commented Jul 24, 2018

it seems like this got broken by #28671.
Proxy setting can contain separate http and https, but it does not in simplifies case.

In scenario from #31242 we simply get "localhost:3128" string without any protocol specification.
Based on my testing, this would apply to both http & https.

fixes #31242

@wfurt wfurt self-assigned this Jul 24, 2018
@wfurt wfurt requested a review from a team July 24, 2018 06:08
@wfurt
Copy link
Member Author

wfurt commented Jul 24, 2018

@dotnet-bot test outerloop linux x64 debug build
@dotnet-bot test outerloop OSX x64 debug build
@dotnet-bot test outerloop Windows x64 debug build

@wfurt wfurt added the bug Product bug (most likely) label Jul 24, 2018
ParseProxyConfig(proxyHelper.Proxy, out _insecureProxyUri, out _secureProxyUri);
if (_insecureProxyUri == null && _secureProxyUri == null)
{
// If advance parsing by protocol fails, fall-back to simplified parsing.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: advanced

@davidsh davidsh added this to the 3.0 milestone Jul 24, 2018
WinInetProxyHelper proxyHelper = new WinInetProxyHelper();

Assert.True(HttpSystemProxy.TryCreate(out p));
Assert.NotNull(p);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of just Assert'ing for NotNull, you should Assert that the URI created is what you expected. I.e. from the rawProxyString="localhost:1234", you get "http://localhost:1234" etc. You would need to add the expected URI string as an additional InlineData parameter.

Copy link
Contributor

@rmkerr rmkerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once CI is green. Thanks for making this fix.

@@ -80,9 +80,11 @@ public void HttpProxy_SystemProxy_Loaded(string rawProxyString)

Assert.True(HttpSystemProxy.TryCreate(out p));
Assert.NotNull(p);
Assert.Equal(expectedString, p.GetProxy(new Uri(fooHttp)).ToString());
Assert.Equal(expectedString, p.GetProxy(new Uri(fooHttps)).ToString());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is "fooHttp" and "fooHttps" being used here? Shouldn't it be "expectedString" ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p.GetProxy() expects destination URI to pass in and returns proxyURI.
It does not really mater here but we used the foo* as test target elsewhere so it does not mix with proxy values.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Thx.

@wfurt wfurt merged commit 2c5f290 into dotnet:master Jul 24, 2018
@wfurt wfurt deleted the fix_31242 branch July 24, 2018 19:18
@wfurt wfurt restored the fix_31242 branch July 25, 2018 17:57
wfurt added a commit to wfurt/corefx that referenced this pull request Jul 25, 2018
* add back simplified proxy configuration
* add tracing
* feedback from review
wfurt added a commit that referenced this pull request Aug 9, 2018
* add back simplified proxy configuration
* add tracing
* feedback from review
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* add back simplified proxy configuration
* add tracing
* feedback from review


Commit migrated from dotnet/corefx@2c5f290
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Product bug (most likely)
Projects
None yet
4 participants