mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 14:53:43 +01:00
Add unauthenticated HTTP REST interface to public blockchain data.
This commit is contained in:
@@ -946,11 +946,18 @@ void ServiceConnection(AcceptedConnection *conn)
|
||||
if (mapHeaders["connection"] == "close")
|
||||
fRun = false;
|
||||
|
||||
// Process via JSON-RPC API
|
||||
if (strURI == "/") {
|
||||
if (!HTTPReq_JSONRPC(conn, strRequest, mapHeaders, fRun))
|
||||
break;
|
||||
|
||||
// Process via HTTP REST API
|
||||
} else if (strURI.substr(0, 6) == "/rest/") {
|
||||
if (!HTTPReq_REST(conn, strURI, mapHeaders, fRun))
|
||||
break;
|
||||
|
||||
} else {
|
||||
conn->stream() << HTTPError(HTTP_NOT_FOUND, false) << std::flush;
|
||||
conn->stream() << HTTPReply(HTTP_NOT_FOUND, "", false) << std::flush;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user