Fix JsonHubProtocol error message when too many arguments (#2312)
This commit is contained in:
parent
b493f01b35
commit
bff2060454
|
|
@ -630,6 +630,10 @@ namespace Microsoft.AspNetCore.SignalR.Protocol
|
|||
// Set all known arguments
|
||||
arguments[paramIndex] = PayloadSerializer.Deserialize(reader, paramTypes[paramIndex]);
|
||||
}
|
||||
else
|
||||
{
|
||||
reader.Skip();
|
||||
}
|
||||
|
||||
argumentsCount++;
|
||||
paramIndex++;
|
||||
|
|
|
|||
|
|
@ -248,6 +248,8 @@ namespace Microsoft.AspNetCore.SignalR.Common.Tests.Internal.Protocol
|
|||
[InlineData("{'type':1,'invocationId':'42','arguments':[ 'abc', 'xyz'], 'target':'foo'}", "Error binding arguments. Make sure that the types of the provided values match the types of the hub method being invoked.")]
|
||||
[InlineData("{'type':4,'invocationId':'42','target':'foo','arguments':[]}", "Invocation provides 0 argument(s) but target expects 2.")]
|
||||
[InlineData("{'type':4,'invocationId':'42','target':'foo','arguments':[ 'abc', 'xyz']}", "Error binding arguments. Make sure that the types of the provided values match the types of the hub method being invoked.")]
|
||||
[InlineData("{'type':1,'invocationId':'42','target':'foo','arguments':[1,'',{'1':1,'2':2}]}", "Invocation provides 3 argument(s) but target expects 2.")]
|
||||
[InlineData("{'type':1,'arguments':[1,'',{'1':1,'2':2}]},'invocationId':'42','target':'foo'", "Invocation provides 3 argument(s) but target expects 2.")]
|
||||
public void ArgumentBindingErrors(string input, string expectedMessage)
|
||||
{
|
||||
input = Frame(input);
|
||||
|
|
|
|||
Loading…
Reference in New Issue