diff options
author | Wladimir J. van der Laan <laanwj@protonmail.com> | 2020-10-01 17:31:10 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@protonmail.com> | 2020-10-01 17:33:56 +0200 |
commit | 7eab781a145a35d0373c4ab4d237a82b4919e88d (patch) | |
tree | ed5af01ccfec9fcb10129fcceaa01ff0184f5c2d /src | |
parent | 3487e421a7fef4b28381efcf21a7e38483946cec (diff) |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/bitcoin-cli.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index aec4177b19..28394e7041 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -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 |