Clean up (#427)
This commit is contained in:
parent
db868af8d8
commit
186c411f43
|
|
@ -18,9 +18,6 @@ namespace Microsoft.AspNetCore.Sockets.Client
|
|||
{
|
||||
public class LongPollingTransport : ITransport
|
||||
{
|
||||
private static readonly string DefaultUserAgent = "Microsoft.AspNetCore.SignalR.Client/0.0.0";
|
||||
private static readonly ProductInfoHeaderValue DefaultUserAgentHeader = ProductInfoHeaderValue.Parse(DefaultUserAgent);
|
||||
|
||||
private readonly HttpClient _httpClient;
|
||||
private readonly ILogger _logger;
|
||||
private IChannelConnection<SendMessage, Message> _application;
|
||||
|
|
@ -90,7 +87,7 @@ namespace Microsoft.AspNetCore.Sockets.Client
|
|||
while (!cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
var request = new HttpRequestMessage(HttpMethod.Get, pollUrl);
|
||||
request.Headers.UserAgent.Add(DefaultUserAgentHeader);
|
||||
request.Headers.UserAgent.Add(SendUtils.DefaultUserAgentHeader);
|
||||
|
||||
var response = await _httpClient.SendAsync(request, cancellationToken);
|
||||
response.EnsureSuccessStatusCode();
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ namespace Microsoft.AspNetCore.Sockets.Client
|
|||
internal static class SendUtils
|
||||
{
|
||||
private static readonly string DefaultUserAgent = "Microsoft.AspNetCore.SignalR.Client/0.0.0";
|
||||
private static readonly ProductInfoHeaderValue DefaultUserAgentHeader = ProductInfoHeaderValue.Parse(DefaultUserAgent);
|
||||
public static readonly ProductInfoHeaderValue DefaultUserAgentHeader = ProductInfoHeaderValue.Parse(DefaultUserAgent);
|
||||
|
||||
public static async Task SendMessages(Uri sendUrl, IChannelConnection<SendMessage, Message> application, HttpClient httpClient, CancellationTokenSource transportCts, ILogger logger)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -16,9 +16,6 @@ namespace Microsoft.AspNetCore.Sockets.Client
|
|||
{
|
||||
public class ServerSentEventsTransport : ITransport
|
||||
{
|
||||
private static readonly string DefaultUserAgent = "Microsoft.AspNetCore.SignalR.Client/0.0.0";
|
||||
private static readonly ProductInfoHeaderValue DefaultUserAgentHeader = ProductInfoHeaderValue.Parse(DefaultUserAgent);
|
||||
|
||||
private readonly HttpClient _httpClient;
|
||||
private readonly ILogger _logger;
|
||||
private readonly CancellationTokenSource _transportCts = new CancellationTokenSource();
|
||||
|
|
|
|||
Loading…
Reference in New Issue