Skip to content

Commit 5764f87

Browse files
authored
1 parent 065f6aa commit 5764f87

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/libraries/System.Net.Http/src/System/Net/Http/HttpClientHandler.AnyMobile.InvokeNativeHandler.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@
1111
using System.Security.Authentication;
1212
using System.Security.Cryptography.X509Certificates;
1313

14-
#if TARGET_ANDROID
15-
using GetHttpMessageHandlerReturnType = object;
16-
#elif TARGET_IOS || TARGET_MACCATALYST || TARGET_TVOS
17-
using GetHttpMessageHandlerReturnType = System.Net.Http.HttpMessageHandler;
18-
#endif
19-
2014
namespace System.Net.Http
2115
{
2216
public partial class HttpClientHandler : HttpMessageHandler
@@ -338,12 +332,10 @@ private void SetCredentials(ICredentials? value)
338332

339333
private static HttpMessageHandler CreateNativeHandler()
340334
{
341-
return (HttpMessageHandler)CallNative(null);
335+
return CallNative(null);
342336

343-
#pragma warning disable SA1121 // Use built-in type alias. We need to alias here for Android.
344337
[UnsafeAccessor(UnsafeAccessorKind.StaticMethod, Name = "GetHttpMessageHandler")]
345-
static extern GetHttpMessageHandlerReturnType CallNative([UnsafeAccessorType(GetHttpMessageHandlerType)] object? _);
346-
#pragma warning restore SA1121
338+
static extern HttpMessageHandler CallNative([UnsafeAccessorType(GetHttpMessageHandlerType)] object? _);
347339
}
348340
}
349341
}

0 commit comments

Comments
 (0)