This commit is contained in:
anlicheng 2024-10-14 20:31:26 +08:00
parent e41d73db8d
commit 5a95d64c0e
2 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ init(Req0, Opts) ->
{ok, ReqBody, Req1} = parse_body(Req0), {ok, ReqBody, Req1} = parse_body(Req0),
Sign = cowboy_req:header(<<"sign">>, Req1, <<>>), Sign = cowboy_req:header(<<"sign">>, Req1, <<>>),
BodySign = njau_bot_signer:sign(ReqBody), BodySign = njau_bot_signer:sign(ReqBody),
case BodySign =:= Sign of case BodySign =:= string:lowercase(Sign) of
true -> true ->
{ok, StatusCode, Resp} = handle_request(Method, Path, ReqBody), {ok, StatusCode, Resp} = handle_request(Method, Path, ReqBody),
lager:debug("[http_protocol] request path: ~p, post_params: ~p, response: ~ts", lager:debug("[http_protocol] request path: ~p, post_params: ~p, response: ~ts",

View File

@ -10,7 +10,7 @@
-author("anlicheng"). -author("anlicheng").
%% API %% API
-export([sign/1]). -export([sign/1, md5/1]).
%% %%
-spec sign(S :: binary()) -> binary(). -spec sign(S :: binary()) -> binary().