Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
xingsy97 committed Jan 22, 2025
1 parent 42e33ca commit 5c1f339
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ private Task ProcessNegotiationRequest(IOwinContext owinContext, HostContext con
// add OriginalPath and QueryString when the clients protocol is higher than 2.0, earlier ASP.NET SignalR clients does not support redirect URL with query parameters
if (!string.IsNullOrEmpty(clientProtocol) && Version.TryParse(clientProtocol, out var version) && version >= ClientSupportQueryStringVersion)
{
var clientRequestId = _connectionRequestIdProvider.GetRequestId("aspnet");
var clientRequestId = _connectionRequestIdProvider.GetRequestId("");
if (clientRequestId != null)
{
// remove system preserved query strings
Expand Down
4 changes: 3 additions & 1 deletion src/Microsoft.Azure.SignalR.Common/Auth/AuthUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ public static string GenerateRequestId(string traceIdentifier)
{
// Before filled into query string, this id will be process by "WebUtility.UrlEncode(...)". So base64 encoding is not needed.
// Use hex to shorten the length.
return $"{traceIdentifier}:{Stopwatch.GetTimestamp().ToString("X")}";
return string.IsNullOrEmpty(traceIdentifier)
? Stopwatch.GetTimestamp().ToString("X")
: $"{traceIdentifier}-{Stopwatch.GetTimestamp().ToString("X")}";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using Microsoft.Azure.SignalR.Protocol;
using Microsoft.Extensions.Logging;

namespace Microsoft.Azure.SignalR.IntegrationTests.Infrastructure
namespace Microsoft.Azure.SignalR.IntegrationTests.Infrastructure;

internal class MockServiceConnectionFactory : ServiceConnectionFactory
{
Expand All @@ -24,18 +24,17 @@ public MockServiceConnectionFactory(
IServerNameProvider nameProvider,
IHubProtocolResolver hubProtocolResolver)
: base(
serviceProtocol,
clientConnectionManager,
connectionFactory,
loggerFactory,
connectionDelegate,
clientConnectionFactory,
nameProvider,
null,
clientInvocationManager,
hubProtocolResolver,
null,
null)
serviceProtocol,
clientConnectionManager,
connectionFactory,
loggerFactory,
connectionDelegate,
clientConnectionFactory,
nameProvider,
null,
clientInvocationManager,
hubProtocolResolver,
null)
{
_mockService = mockService;
}
Expand All @@ -45,4 +44,4 @@ public override IServiceConnection Create(HubServiceEndpoint endpoint, IServiceM
var serviceConnection = base.Create(endpoint, serviceMessageHandler, ackHandler, type);
return new MockServiceConnection(_mockService, serviceConnection);
}
}
}

0 comments on commit 5c1f339

Please sign in to comment.