JsonHubProtocol and MessagePackHubProtocol version fields now private (#2023)
This commit is contained in:
parent
5a77c8be25
commit
377ed1b834
|
|
@ -28,8 +28,8 @@ namespace Microsoft.AspNetCore.SignalR.Protocol
|
||||||
private const string ArgumentsPropertyName = "arguments";
|
private const string ArgumentsPropertyName = "arguments";
|
||||||
private const string HeadersPropertyName = "headers";
|
private const string HeadersPropertyName = "headers";
|
||||||
|
|
||||||
public static readonly string ProtocolName = "json";
|
private static readonly string ProtocolName = "json";
|
||||||
public static readonly int ProtocolVersion = 1;
|
private static readonly int ProtocolVersion = 1;
|
||||||
|
|
||||||
// ONLY to be used for application payloads (args, return values, etc.)
|
// ONLY to be used for application payloads (args, return values, etc.)
|
||||||
public JsonSerializer PayloadSerializer { get; }
|
public JsonSerializer PayloadSerializer { get; }
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,8 @@ namespace Microsoft.AspNetCore.SignalR.Protocol
|
||||||
|
|
||||||
private IFormatterResolver _resolver;
|
private IFormatterResolver _resolver;
|
||||||
|
|
||||||
public static readonly string ProtocolName = "messagepack";
|
private static readonly string ProtocolName = "messagepack";
|
||||||
public static readonly int ProtocolVersion = 1;
|
private static readonly int ProtocolVersion = 1;
|
||||||
|
|
||||||
public string Name => ProtocolName;
|
public string Name => ProtocolName;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -117,11 +117,11 @@ namespace Microsoft.AspNetCore.SignalR.Redis.Tests
|
||||||
{
|
{
|
||||||
foreach (var transport in TransportTypes())
|
foreach (var transport in TransportTypes())
|
||||||
{
|
{
|
||||||
yield return new object[] { transport, JsonHubProtocol.ProtocolName };
|
yield return new object[] { transport, "json" };
|
||||||
|
|
||||||
if (transport != HttpTransportType.ServerSentEvents)
|
if (transport != HttpTransportType.ServerSentEvents)
|
||||||
{
|
{
|
||||||
yield return new object[] { transport, MessagePackHubProtocol.ProtocolName };
|
yield return new object[] { transport, "messagepack" };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ namespace Microsoft.AspNetCore.SignalR.Common.Protocol.Tests
|
||||||
new JsonHubProtocol()
|
new JsonHubProtocol()
|
||||||
}, NullLogger<DefaultHubProtocolResolver>.Instance));
|
}, NullLogger<DefaultHubProtocolResolver>.Instance));
|
||||||
|
|
||||||
Assert.Equal($"Multiple Hub Protocols with the name '{JsonHubProtocol.ProtocolName}' were registered.", exception.Message);
|
Assert.Equal($"Multiple Hub Protocols with the name 'json' were registered.", exception.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IEnumerable<object[]> HubProtocolNames => HubProtocolHelpers.AllProtocols.Select(p => new object[] {p.Name});
|
public static IEnumerable<object[]> HubProtocolNames => HubProtocolHelpers.AllProtocols.Select(p => new object[] {p.Name});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue