Merge pull request #12173 from zhongwencool/authz-headers
feat: don't merge authz default headers if user already setting
This commit is contained in:
commit
4cab42bbbe
|
@ -1,7 +1,7 @@
|
||||||
%% -*- mode: erlang -*-
|
%% -*- mode: erlang -*-
|
||||||
{application, emqx_auth_http, [
|
{application, emqx_auth_http, [
|
||||||
{description, "EMQX External HTTP API Authentication and Authorization"},
|
{description, "EMQX External HTTP API Authentication and Authorization"},
|
||||||
{vsn, "0.1.1"},
|
{vsn, "0.1.2"},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{mod, {emqx_auth_http_app, []}},
|
{mod, {emqx_auth_http_app, []}},
|
||||||
{applications, [
|
{applications, [
|
||||||
|
|
|
@ -113,7 +113,7 @@ headers(desc) ->
|
||||||
?DESC(?FUNCTION_NAME);
|
?DESC(?FUNCTION_NAME);
|
||||||
headers(converter) ->
|
headers(converter) ->
|
||||||
fun(Headers) ->
|
fun(Headers) ->
|
||||||
maps:to_list(maps:merge(default_headers(), transform_header_name(Headers)))
|
maps:to_list(transform_header_name(Headers))
|
||||||
end;
|
end;
|
||||||
headers(default) ->
|
headers(default) ->
|
||||||
default_headers();
|
default_headers();
|
||||||
|
@ -129,7 +129,7 @@ headers_no_content_type(converter) ->
|
||||||
maps:to_list(
|
maps:to_list(
|
||||||
maps:without(
|
maps:without(
|
||||||
[<<"content-type">>],
|
[<<"content-type">>],
|
||||||
maps:merge(default_headers_no_content_type(), transform_header_name(Headers))
|
transform_header_name(Headers)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
end;
|
end;
|
||||||
|
|
Loading…
Reference in New Issue