Просмотр исходного кода

Merge pull request #6435 from JimMoen/fix-ssl-file-content

fix(ssl): file content return type
JimMoen 4 лет назад
Родитель
Сommit
40c4880a71
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      apps/emqx/src/emqx_tls_lib.erl

+ 3 - 2
apps/emqx/src/emqx_tls_lib.erl

@@ -353,11 +353,12 @@ is_valid_pem_file(Path) ->
 %% @doc This is to return SSL file content in management APIs.
 %% @doc This is to return SSL file content in management APIs.
 file_content_as_options(undefined) -> undefined;
 file_content_as_options(undefined) -> undefined;
 file_content_as_options(#{<<"enable">> := false} = SSL) ->
 file_content_as_options(#{<<"enable">> := false} = SSL) ->
-    maps:without(?SSL_FILE_OPT_NAMES, SSL);
+    {ok, maps:without(?SSL_FILE_OPT_NAMES, SSL)};
 file_content_as_options(#{<<"enable">> := true} = SSL) ->
 file_content_as_options(#{<<"enable">> := true} = SSL) ->
     file_content_as_options(?SSL_FILE_OPT_NAMES, SSL).
     file_content_as_options(?SSL_FILE_OPT_NAMES, SSL).
 
 
-file_content_as_options([], SSL) -> {ok, SSL};
+file_content_as_options([], SSL) ->
+    {ok, SSL};
 file_content_as_options([Key | Keys], SSL) ->
 file_content_as_options([Key | Keys], SSL) ->
     case maps:get(Key, SSL, undefined) of
     case maps:get(Key, SSL, undefined) of
         undefined -> file_content_as_options(Keys, SSL);
         undefined -> file_content_as_options(Keys, SSL);