diff options
Diffstat (limited to 'src/DotNetOpenAuth.OAuth2')
-rw-r--r-- | src/DotNetOpenAuth.OAuth2/DefaultOAuth2HostFactories.cs | 50 | ||||
-rw-r--r-- | src/DotNetOpenAuth.OAuth2/DotNetOpenAuth.OAuth2.csproj | 1 |
2 files changed, 0 insertions, 51 deletions
diff --git a/src/DotNetOpenAuth.OAuth2/DefaultOAuth2HostFactories.cs b/src/DotNetOpenAuth.OAuth2/DefaultOAuth2HostFactories.cs deleted file mode 100644 index cc6aefc..0000000 --- a/src/DotNetOpenAuth.OAuth2/DefaultOAuth2HostFactories.cs +++ /dev/null @@ -1,50 +0,0 @@ -//----------------------------------------------------------------------- -// <copyright file="DefaultOAuth2HostFactories.cs" company="Andrew Arnott"> -// Copyright (c) Andrew Arnott. All rights reserved. -// </copyright> -//----------------------------------------------------------------------- - -namespace DotNetOpenAuth.OAuth2 { - using System; - using System.Collections.Generic; - using System.Linq; - using System.Net.Cache; - using System.Net.Http; - using System.Text; - using System.Threading.Tasks; - - /// <summary> - /// Creates default instances of required dependencies. - /// </summary> - public class DefaultOAuth2HostFactories : IHostFactories { - /// <summary> - /// Initializes a new instance of a concrete derivation of <see cref="HttpMessageHandler" /> - /// to be used for outbound HTTP traffic. - /// </summary> - /// <returns>An instance of <see cref="HttpMessageHandler"/>.</returns> - /// <remarks> - /// An instance of <see cref="WebRequestHandler" /> is recommended where available; - /// otherwise an instance of <see cref="HttpClientHandler" /> is recommended. - /// </remarks> - public virtual HttpMessageHandler CreateHttpMessageHandler() { - var handler = new HttpClientHandler(); - return handler; - } - - /// <summary> - /// Initializes a new instance of the <see cref="HttpClient" /> class - /// to be used for outbound HTTP traffic. - /// </summary> - /// <param name="handler">The handler to pass to the <see cref="HttpClient" /> constructor. - /// May be null to use the default that would be provided by <see cref="CreateHttpMessageHandler" />.</param> - /// <returns> - /// An instance of <see cref="HttpClient" />. - /// </returns> - public HttpClient CreateHttpClient(HttpMessageHandler handler) { - handler = handler ?? this.CreateHttpMessageHandler(); - var client = new HttpClient(handler); - client.DefaultRequestHeaders.UserAgent.Add(Util.LibraryVersionHeader); - return client; - } - } -} diff --git a/src/DotNetOpenAuth.OAuth2/DotNetOpenAuth.OAuth2.csproj b/src/DotNetOpenAuth.OAuth2/DotNetOpenAuth.OAuth2.csproj index 1cf7fd2..d0c3626 100644 --- a/src/DotNetOpenAuth.OAuth2/DotNetOpenAuth.OAuth2.csproj +++ b/src/DotNetOpenAuth.OAuth2/DotNetOpenAuth.OAuth2.csproj @@ -20,7 +20,6 @@ </PropertyGroup> <ItemGroup> <Compile Include="Configuration\OAuth2SectionGroup.cs" /> - <Compile Include="DefaultOAuth2HostFactories.cs" /> <Compile Include="GlobalSuppressions.cs" /> <Compile Include="OAuth2\AccessToken.cs" /> <Compile Include="OAuth2\ChannelElements\AuthorizationDataBag.cs" /> |