Skip to content

Commit 60ec57b

Browse files
committed
Merge #20055: rpc: Set HTTP Content-Type in bitcoin-cli
7eab781 rpc: Set HTTP Content-Type in bitcoin-cli (Wladimir J. van der Laan) Pull request description: 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 at all for a POST request. This came up in #18950. ACKs for top commit: promag: ACK 7eab781. jonatack: Tested ACK 7eab781 practicalswift: ACK 7eab781: patch looks correct fanquake: ACK 7eab781 - Looks fine to me. Tree-SHA512: a9fa155324d0f7bff955585a336ead6bb60b721039f424521a435e4bb0fad3f4532e5cc7b7a9acc4e93585e8d3db3082c010138810f22c0e92b8f749b86ef653
2 parents a6a993a + 7eab781 commit 60ec57b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/bitcoin-cli.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,7 @@ static UniValue CallRPC(BaseRequestHandler* rh, const std::string& strMethod, co
596596
assert(output_headers);
597597
evhttp_add_header(output_headers, "Host", host.c_str());
598598
evhttp_add_header(output_headers, "Connection", "close");
599+
evhttp_add_header(output_headers, "Content-Type", "application/json");
599600
evhttp_add_header(output_headers, "Authorization", (std::string("Basic ") + EncodeBase64(strRPCUserColonPass)).c_str());
600601

601602
// Attach request data

0 commit comments

Comments
 (0)