fix: api auth header support

This commit is contained in:
DDDHuang 2021-07-15 13:56:07 +08:00 committed by turtleDeng
parent 980c7d91db
commit e838df99a9
1 changed files with 2 additions and 2 deletions

View File

@ -101,10 +101,10 @@ authorize_appid(Req) ->
{basic, AppId, AppSecret} -> {basic, AppId, AppSecret} ->
case emqx_mgmt_auth:is_authorized(AppId, AppSecret) of case emqx_mgmt_auth:is_authorized(AppId, AppSecret) of
true -> ok; true -> ok;
false -> {401} false -> {401, #{<<"WWW-Authenticate">> => <<"Basic Realm=\"minirest-server\"">>}, <<"UNAUTHORIZED">>}
end; end;
_ -> _ ->
{401} {401, #{<<"WWW-Authenticate">> => <<"Basic Realm=\"minirest-server\"">>}, <<"UNAUTHORIZED">>}
end. end.
format(Port) when is_integer(Port) -> format(Port) when is_integer(Port) ->