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
{{ message }}
Repository navigation
Commit 2337f99
Browse filesBrowse the repository at this point in the historyBrowse files
[json_rpc_2] Add strictProtocolChecks parameter to Client (dart-lang#2555)
Closesdart-lang#2422
`Server` and `Peer` already accept a `strictProtocolChecks` flag that
allows requests which don't include the `jsonrpc` field. `Client` had no
equivalent, so there was no way to interoperate with a peer whose
responses omit that field.
Add a `strictProtocolChecks` parameter to `Client` and
`Client.withoutJson`, defaulting to `true` to match `Server`. When it is
`false`, a response missing the `jsonrpc` key is accepted, but a response
with a `jsonrpc` key set to anything other than `"2.0"` is still
rejected.
Pass the flag through `Peer.withoutJson` to the internal `Client`, so
`Peer(strictProtocolChecks: false)` relaxes response validation on the
client side as well as request validation on the server side.
0 commit comments