Merge pull request #12173 from zhongwencool/authz-headers

feat: don't merge authz default headers if user already setting
This commit is contained in:
zhongwencool 2023-12-15 11:36:38 +08:00 committed by GitHub
commit 4cab42bbbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -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, [

View File

@ -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;