You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrownewInvalidDataException("Error binding arguments. Make sure that the types of the provided values match the types of the hub method being invoked.",ex);
715
+
}
738
716
}
739
-
catch(Exceptionex)
717
+
else
740
718
{
741
-
thrownewInvalidDataException("Error binding arguments. Make sure that the types of the provided values match the types of the hub method being invoked.",ex);
719
+
// Skip extra arguments and throw error after reading them all
720
+
reader.Skip();
742
721
}
722
+
reader.CheckRead();
723
+
paramIndex++;
724
+
}
725
+
726
+
if(paramIndex!=paramCount)
727
+
{
728
+
thrownewInvalidDataException($"Invocation provides {paramIndex} argument(s) but target expects {paramCount}.");
Copy file name to clipboardExpand all lines: src/SignalR/common/SignalR.Common/test/Internal/Protocol/JsonHubProtocolTestsBase.cs
+14-3Lines changed: 14 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -205,9 +205,8 @@ public void ExtraItemsInMessageAreIgnored(string input)
205
205
[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.")]
206
206
[InlineData("{\"type\":1,\"invocationId\":\"42\",\"target\":\"foo\",\"arguments\":[1,\"\",{\"1\":1,\"2\":2}]}","Invocation provides 3 argument(s) but target expects 2.")]
207
207
[InlineData("{\"type\":1,\"arguments\":[1,\"\",{\"1\":1,\"2\":2}]},\"invocationId\":\"42\",\"target\":\"foo\"","Invocation provides 3 argument(s) but target expects 2.")]
208
-
// Both of these should be fixed by https://github.com/dotnet/corefx/issues/36901
209
-
// [InlineData("{\"type\":1,\"invocationId\":\"42\",\"target\":\"foo\",\"arguments\":[1,[1]]}", "Error binding arguments. Make sure that the types of the provided values match the types of the hub method being invoked.")]
210
-
// [InlineData("{\"type\":1,\"invocationId\":\"42\",\"target\":\"foo\",\"arguments\":[1,[]]}", "Error binding arguments. Make sure that the types of the provided values match the types of the hub method being invoked.")]
208
+
[InlineData("{\"type\":1,\"invocationId\":\"42\",\"target\":\"foo\",\"arguments\":[1,[1]]}","Error binding arguments. Make sure that the types of the provided values match the types of the hub method being invoked.")]
209
+
[InlineData("{\"type\":1,\"invocationId\":\"42\",\"target\":\"foo\",\"arguments\":[1,[]]}","Error binding arguments. Make sure that the types of the provided values match the types of the hub method being invoked.")]
0 commit comments