-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[WinHTTP] Remove legacy (Win 8.1-) WinInet proxy handling #113915
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
Conversation
|
Tagging subscribers to this area: @dotnet/ncl |
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.
Pull Request Overview
This PR removes the legacy WinInet proxy handling that was only used for Windows 8.1 and earlier. The key changes include:
- Removing the WinInetProxyHelper usage and related legacy fallback code in WinHttpHandler.
- Migrating and adding tests for HttpWindowsProxy in System.Net.Http.UnitTests.
- Eliminating obsolete tests and TestControl properties from the WinHttpHandler unit tests.
Reviewed Changes
Copilot reviewed 7 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/libraries/System.Net.Http/tests/UnitTests/HttpWindowsProxyTest.cs | Added new tests for verifying manual proxy settings with auto-detection failures and manual-only scenarios. |
| src/libraries/System.Net.Http.WinHttpHandler/tests/UnitTests/WinHttpHandlerTest.cs | Removed tests that relied on the legacy WinInet proxy handling and the WinHttpAutomaticProxySupport property. |
| src/libraries/System.Net.Http.WinHttpHandler/tests/UnitTests/TestControl.cs | Removed obsolete WinHttpAutomaticProxySupport property. |
| src/libraries/System.Net.Http.WinHttpHandler/tests/UnitTests/FakeInterop.cs | Removed legacy branch handling based on WinHttpAutomaticProxySupport. |
| src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpHandler.cs | Stripped legacy fallback logic for WinInet proxy detection and updated proxy option handling. |
Files not reviewed (4)
- src/libraries/System.Net.Http.WinHttpHandler/src/System.Net.Http.WinHttpHandler.csproj: Language not supported
- src/libraries/System.Net.Http.WinHttpHandler/tests/UnitTests/System.Net.Http.WinHttpHandler.Unit.Tests.csproj: Language not supported
- src/libraries/System.Net.Http/src/System.Net.Http.csproj: Language not supported
- src/libraries/System.Net.Http/tests/UnitTests/System.Net.Http.Unit.Tests.csproj: Language not supported
Comments suppressed due to low confidence (1)
src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpHandler.cs:815
- Consider adding a comment here to clearly explain that the legacy fallback to WinInetProxyHelper has been removed, which will help future maintainers understand this intentional change.
ThrowOnInvalidHandle(sessionHandle, nameof(Interop.WinHttp.WinHttpOpen));
Usage of
WinInetProxyHelperwas relevant only for legacy Windows 8.1-. Since 8.1, WinHTTP handles per-user proxies itself, see https://learn.microsoft.com/en-us/windows/win32/api/winhttp/nf-winhttp-winhttpopen.Removed the helper from
WinHttpHandlerand moved the few tests to S.N.Http.UnitTests next to the otherHttpWindowsProxytests.Note that
HttpWindowsProxyis the last user ofWinInetProxyHelperso I moved the source file from Common. I can move it back there if we think this has a potential for being shared.