mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-26 03:03:22 -03:00
rpc: Set HTTP Content-Type in bitcoin-cli
We don't set any `Content-Type` in the client. It is more consistent with our other JSON-RPC use to set it to `application/json`. Note that our server doesn't enforce content types, so it doesn't make a difference in practice. But it is fairly strange HTTP behavior to not set it. This came up in #18950.
This commit is contained in:
parent
3487e421a7
commit
7eab781a14
1 changed files with 1 additions and 0 deletions
|
@ -596,6 +596,7 @@ static UniValue CallRPC(BaseRequestHandler* rh, const std::string& strMethod, co
|
|||
assert(output_headers);
|
||||
evhttp_add_header(output_headers, "Host", host.c_str());
|
||||
evhttp_add_header(output_headers, "Connection", "close");
|
||||
evhttp_add_header(output_headers, "Content-Type", "application/json");
|
||||
evhttp_add_header(output_headers, "Authorization", (std::string("Basic ") + EncodeBase64(strRPCUserColonPass)).c_str());
|
||||
|
||||
// Attach request data
|
||||
|
|
Loading…
Add table
Reference in a new issue