Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion config/static_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ components_manager:
#
handler-JsonRpc:
path: /api/v2/jsonRPC
method: POST
method: GET,POST
logger: api-v2-jsonrpc
port: $server_port
port#fallback: 8081
Expand All @@ -372,6 +372,7 @@ components_manager:
handler-static:
fs-cache-component: fs-cache-main
path: /api/v2/*
not-found-file: /404.json
method: GET

#
Expand Down
3 changes: 3 additions & 0 deletions ton-http-api/src/handlers/JsonRpcHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ std::string JsonRpcHandler::HandleRequestThrow(
const HttpRequest& request, RequestContext&
) const {
try {
if (request.GetMethod() == userver::server::http::HttpMethod::kGet) {
throw utils::TonlibException("method GET is not supported", 405);
}
auto request_json = userver::formats::json::FromString(request.RequestBody());
auto method = request_json["method"].As<std::string>();
userver::formats::json::Value params = userver::formats::json::MakeObject();
Expand Down
1 change: 1 addition & 0 deletions ton-http-api/static/404.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ok":false,"error":"Not Found","code":404,"@extra":"_"}