fix: api auth header support
This commit is contained in:
parent
980c7d91db
commit
e838df99a9
|
@ -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) ->
|
||||||
|
|
Loading…
Reference in New Issue