Skip to content

HttpHandlerResource has a HttpClientHandler property which is not available when using NSUrlSessionHandler on the Mac #7298

Open
@mrward

Description

@mrward

Details about Problem

The HttpHandlerResource has a HttpClientHandler property. A native HttpMessageHandler, which can be used by HttpClient, does not have to be a HttpClientHandler derived class. With Xamarin.Mac the native handler is NSUrlSessionHandler which derives from HttpMessageHandler. The NSUrlSessionHandler cannot be used with the HttpHandlerResourceV3 and a null value cannot be passed since there is a null check.

Searching the code it looks like the only place where this is used is in the DownloadResourcePluginProvider class where it is used to pass the HttpClientHandler.Proxy to the GetCredentialsRequestHandler. Is there another way we can handle this without requiring a HttpClientHandler as part of the HttpHandlerResource?

For now I can create a dummy HttpClientHandler - however if NuGet starts using the HttpClientHandler property for other things then this will likely not work if Visual Studio for Mac is using the NSUrlSessionHandler. Visual Studio for Mac can implement its own version of the HttpHandlerResourceV3Provider but having HttpHandlerResourceV3 require a HttpClientHandler is problematic here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area:HttpCommunicationFunctionality:SDKThe NuGet client packages published to nuget.orgPriority:3Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog.Type:DCRDesign Change Request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions