Merge bitcoin/bitcoin#26628: RPC: Reject RPC requests with same named parameter specified multiple times
8c3ff7d52atest: Suggested cleanups for rpc_namedparams test (Ryan Ofsky)d1ca563825bitcoin-cli: Make it an error to specify the "args" parameter two different ways (Ryan Ofsky)6bd1d20b8crpc: Make it an error server-side to specify same named parameter multiple times (Ryan Ofsky)e2c3b18e67test: Add RPC tests for same named parameter specified more than once (Ryan Ofsky) Pull request description: Make the JSON-RPC server reject requests with the same named parameter specified multiple times, instead of silently overwriting earlier parameter values with later ones. Generally JSON keys are supposed to unique, and their order isn't supposed to be significant, so having the server silently discard duplicate keys is error-prone. Most likely if an RPC client is sending a request with duplicate keys it means something is wrong with the request and there should be an error. After this change, named parameters are still allowed to specified multiple times on the `bitcoin-cli` command line, since `bitcoin-cli` automatically replaces earlier values with later values before sending the JSON-RPC request. This makes sense, since it's not unusual for the order of command line options to be significant or for later command line options to override earlier ones. ACKs for top commit: MarcoFalke: review ACK8c3ff7d52a🗂 kristapsk: ACK8c3ff7d52astickies-v: ACK8c3ff7d52Tree-SHA512: 2d1357dcc2c171da287aeefc7b333ba4e67babfb64fc14d7fa0940256e18010a2a65054f3bf7fa1571b144d2de8b82d53076111b5f97ba29320cfe84b6ed986f
This commit is contained in:
5 files changed
+25
-4
No files matched your search
@@ -0,0 +1,4 @@
|
||||
JSON-RPC
|
||||
---
|
||||
|
||||
The JSON-RPC server now rejects requests where a parameter is specified multiple times with the same name, instead of silently overwriting earlier parameter values with later ones. (#26628)
|
||||
Reference in new issue
Block a user