From 766ac31b4f2f33a69cc923cffe7e0c1e23b4613e Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Tue, 10 Sep 2024 16:02:37 +0800 Subject: [PATCH] add sign --- apps/njau_bot/src/http_handler/api_handler.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/njau_bot/src/http_handler/api_handler.erl b/apps/njau_bot/src/http_handler/api_handler.erl index ca8f95a..37efc47 100644 --- a/apps/njau_bot/src/http_handler/api_handler.erl +++ b/apps/njau_bot/src/http_handler/api_handler.erl @@ -30,6 +30,7 @@ init(Req0, Opts) -> }, Resp, Req1), {ok, Req2, Opts}; false -> + lager:debug("[api_handler] invalid sign: ~p", [Sign]), Req2 = cowboy_req:reply(500, #{ <<"Content-Type">> => <<"text/html;charset=utf-8">> }, <<"Internal Server Error">>, Req1), @@ -39,7 +40,7 @@ init(Req0, Opts) -> handle_request("POST", "/api/device_info", _, Params) -> njau_bot_logger:write(jiffy:encode(Params, [force_utf8])), - {ok, 200, json_data(<<"hello world">>)}; + {ok, 200, json_data(<<"ok">>)}; handle_request(_, Path, _, _) -> Path1 = list_to_binary(Path),