Skip to content
This repository was archived by the owner on Jul 9, 2023. It is now read-only.

Commit f225e38

Browse files
committed
fix test fail
1 parent 4bab38d commit f225e38

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Titanium.Web.Proxy/ExplicitClientHandler.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,13 @@ await clientStreamWriter.WriteResponseAsync(connectArgs.HttpClient.Response,
154154

155155
if (EnableTcpServerConnectionPrefetch)
156156
{
157-
//make sure the host can be resolved before creating the prefetch task
158-
var ipAddresses = await Dns.GetHostAddressesAsync(connectArgs.HttpClient.Request.RequestUri.Host);
157+
IPAddress[] ipAddresses = null;
158+
try
159+
{
160+
//make sure the host can be resolved before creating the prefetch task
161+
ipAddresses = await Dns.GetHostAddressesAsync(connectArgs.HttpClient.Request.RequestUri.Host);
162+
}
163+
catch (SocketException) { }
159164

160165
if (ipAddresses != null && ipAddresses.Length > 0)
161166
{

0 commit comments

Comments
 (0)