Remove System.Net.Http dependency on System.Text.RegularExpressions (dotnet/corefx...
authorStephen Toub <stoub@microsoft.com>
Mon, 16 Sep 2019 18:56:59 +0000 (14:56 -0400)
committerGitHub <noreply@github.com>
Mon, 16 Sep 2019 18:56:59 +0000 (14:56 -0400)
commit78d665b987499774090f902c89b1f44fe942b99c
tree9b90e3ed847b4426a60a3fe3ba4a4a7150e44385
parent4a5da0ecd69bfab70881c25cb9c390ca1f073751
Remove System.Net.Http dependency on System.Text.RegularExpressions (dotnet/corefx#41110)

* Remove System.Net.Http dependency on System.Text.RegularExpressions

This dependency is the only reason we end up with a 105K System.Text.RegularExpressions.dll as part of a trimmed new MVC app.  Regex is used in the case where on Windows a bypass list is provided, in which case each item in the list is changed into a regex, which is then evaluated against each url provided to SocketsHttpHandler.  But the patterns usable are simple: the only special character recognized is an asterisk, which can map to zero or more of any character.  So, we can instead employ a simple processor for such patterns, which then eliminates the need to reference System.Text.RegularExpressions.dll from System.Net.Http.dll.  It also happens to be faster.

* Address PR feedback

* Update src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpWindowsProxy.cs

Co-Authored-By: Jan Kotas <jkotas@microsoft.com>
Commit migrated from https://github.com/dotnet/corefx/commit/0e65e923689962f9634b5948d15f995140cc7c93
src/libraries/Common/src/System/Text/SimpleRegex.cs [new file with mode: 0644]
src/libraries/Common/tests/Common.Tests.csproj
src/libraries/Common/tests/Tests/System/Text/SimpleRegexTests.cs [new file with mode: 0644]
src/libraries/System.Net.Http.WinHttpHandler/tests/UnitTests/System.Net.Http.WinHttpHandler.Unit.Tests.csproj
src/libraries/System.Net.Http/src/System.Net.Http.csproj
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpWindowsProxy.cs
src/libraries/System.Net.Http/tests/UnitTests/System.Net.Http.Unit.Tests.csproj