فهرست منبع

fix(emqx_packet): log empty string if password value is missing

to keep it a consistent behaviour comparing when logging username
Zaiming (Stone) Shi 3 سال پیش
والد
کامیت
2bc19c3a62
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      apps/emqx/src/emqx_packet.erl

+ 2 - 1
apps/emqx/src/emqx_packet.erl

@@ -601,7 +601,8 @@ format_variable(#mqtt_packet_auth{reason_code = ReasonCode}, _) ->
 format_variable(PacketId, _) when is_integer(PacketId) ->
 format_variable(PacketId, _) when is_integer(PacketId) ->
     io_lib:format("PacketId=~p", [PacketId]).
     io_lib:format("PacketId=~p", [PacketId]).
 
 
-format_password(undefined) -> "undefined";
+format_password(undefined) -> "";
+format_password(<<>>) -> "";
 format_password(_Password) -> "******".
 format_password(_Password) -> "******".
 
 
 format_payload(Payload, text) -> ["Payload=", io_lib:format("~ts", [Payload])];
 format_payload(Payload, text) -> ["Payload=", io_lib:format("~ts", [Payload])];