Merge pull request #9360 from JimMoen/fix-api-method-case-sensitive
fix(api): uppercase api request method
This commit is contained in:
commit
1f05498b27
|
@ -124,7 +124,10 @@ handle_request(_Method, _Path, Req) ->
|
|||
cowboy_req:reply(400, #{<<"content-type">> => <<"text/plain">>}, <<"Not found.">>, Req).
|
||||
|
||||
authorize_appid(Req) ->
|
||||
authorize_appid(cowboy_req:method(Req), cowboy_req:path(Req), Req).
|
||||
authorize_appid(
|
||||
iolist_to_binary(string:uppercase(cowboy_req:method(Req))),
|
||||
iolist_to_binary(cowboy_req:path(Req)),
|
||||
Req).
|
||||
|
||||
authorize_appid(<<"GET">>, <<"/api/v4/emqx_prometheus">>, _Req) ->
|
||||
true;
|
||||
|
|
|
@ -107,7 +107,10 @@ http_handlers() ->
|
|||
%%--------------------------------------------------------------------
|
||||
|
||||
is_authorized(Req) ->
|
||||
is_authorized(cowboy_req:method(Req), cowboy_req:path(Req), Req).
|
||||
is_authorized(
|
||||
iolist_to_binary(string:uppercase(cowboy_req:method(Req))),
|
||||
iolist_to_binary(cowboy_req:path(Req)),
|
||||
Req).
|
||||
|
||||
is_authorized(<<"GET">>, <<"/api/v4/emqx_prometheus">>, _Req) ->
|
||||
true;
|
||||
|
|
Loading…
Reference in New Issue