mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Add unauthenticated HTTP REST interface to public blockchain data.
This commit is contained in:
parent
83f5daf2fe
commit
e2655e0ab1
4 changed files with 216 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue