Skip to content

Commit

Permalink
nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
BrennanConroy committed Feb 16, 2021
1 parent a369686 commit b6ebf52
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ private static IHubConnectionBuilder WithUrlCore(this IHubConnectionBuilder hubC
private class HttpConnectionOptionsDerivedHttpEndPoint : UriEndPoint
{
public HttpConnectionOptionsDerivedHttpEndPoint(IOptions<HttpConnectionOptions> httpConnectionOptions)
: base(httpConnectionOptions.Value.Url)
: base(httpConnectionOptions.Value.Url!)
{
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public partial class HttpConnection : ConnectionContext, IConnectionInherentKeep
private string? _connectionId;
private readonly ConnectionLogScope _logScope;
private readonly ILoggerFactory _loggerFactory;
private readonly Uri _url;
private Func<Task<string?>>? _accessTokenProvider;

/// <inheritdoc />
Expand Down Expand Up @@ -148,6 +149,8 @@ public HttpConnection(HttpConnectionOptions httpConnectionOptions, ILoggerFactor
_logger = _loggerFactory.CreateLogger<HttpConnection>();
_httpConnectionOptions = httpConnectionOptions;

_url = _httpConnectionOptions.Url;

if (!httpConnectionOptions.SkipNegotiation || httpConnectionOptions.Transports != HttpTransportType.WebSockets)
{
_httpClient = CreateHttpClient();
Expand Down Expand Up @@ -303,7 +306,7 @@ private async Task DisposeAsyncCore()

private async Task SelectAndStartTransport(TransferFormat transferFormat, CancellationToken cancellationToken)
{
var uri = _httpConnectionOptions.Url;
var uri = _url;
// Set the initial access token provider back to the original one from options
_accessTokenProvider = _httpConnectionOptions.AccessTokenProvider;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public CookieContainer Cookies
/// <summary>
/// Gets or sets the URL used to send HTTP requests.
/// </summary>
public Uri Url { get; set; } = default!;
public Uri? Url { get; set; }

/// <summary>
/// Gets or sets a bitmask combining one or more <see cref="HttpTransportType"/> values that specify what transports the client should use to send HTTP requests.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Microsoft.AspNetCore.Http.Connections.Client.HttpConnectionOptions.HttpMessageHa
Microsoft.AspNetCore.Http.Connections.Client.HttpConnectionOptions.HttpMessageHandlerFactory.set -> void
Microsoft.AspNetCore.Http.Connections.Client.HttpConnectionOptions.Proxy.get -> System.Net.IWebProxy?
Microsoft.AspNetCore.Http.Connections.Client.HttpConnectionOptions.Proxy.set -> void
Microsoft.AspNetCore.Http.Connections.Client.HttpConnectionOptions.Url.get -> System.Uri!
Microsoft.AspNetCore.Http.Connections.Client.HttpConnectionOptions.Url.get -> System.Uri?
Microsoft.AspNetCore.Http.Connections.Client.HttpConnectionOptions.Url.set -> void
Microsoft.AspNetCore.Http.Connections.Client.HttpConnectionOptions.WebSocketConfiguration.get -> System.Action<System.Net.WebSockets.ClientWebSocketOptions!>?
Microsoft.AspNetCore.Http.Connections.Client.HttpConnectionOptions.WebSocketConfiguration.set -> void
Expand Down

0 comments on commit b6ebf52

Please sign in to comment.