diff options
author | Ingela Anderton Andin <[email protected]> | 2015-09-03 12:25:03 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2015-09-03 12:25:03 +0200 |
commit | 1ee5aaf02cc2525a2c27b91f5c6c771e4965fd9e (patch) | |
tree | 8d5d41a5371cee812680c326366a14a632f00cb5 /lib/inets/src | |
parent | bf9b55d9341ca6e1bbb8c1d2c2763b17538426b6 (diff) | |
download | otp-1ee5aaf02cc2525a2c27b91f5c6c771e4965fd9e.tar.gz otp-1ee5aaf02cc2525a2c27b91f5c6c771e4965fd9e.tar.bz2 otp-1ee5aaf02cc2525a2c27b91f5c6c771e4965fd9e.zip |
inets: httpd - Add format_status/2 to httpd_request_handler
Avoid printing sensitive information in supervisor logs
Diffstat (limited to 'lib/inets/src')
-rw-r--r-- | lib/inets/src/http_server/httpd_request_handler.erl | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/inets/src/http_server/httpd_request_handler.erl b/lib/inets/src/http_server/httpd_request_handler.erl index 25aea56568..e5d006c1fd 100644 --- a/lib/inets/src/http_server/httpd_request_handler.erl +++ b/lib/inets/src/http_server/httpd_request_handler.erl @@ -30,7 +30,7 @@ %% gen_server callbacks -export([init/1, handle_call/3, handle_cast/2, handle_info/2, - terminate/2, code_change/3]). + terminate/2, code_change/3, format_status/2]). -include("httpd.hrl"). -include("http_internal.hrl"). @@ -310,6 +310,18 @@ do_terminate(#state{mod = ModData} = State) -> cancel_request_timeout(State), httpd_socket:close(ModData#mod.socket_type, ModData#mod.socket). +format_status(normal, [_, State]) -> + [{data, [{"StateData", State}]}]; +format_status(terminate, [_, State]) -> + Mod = (State#state.mod), + case Mod#mod.socket_type of + ip_comm -> + [{data, [{"StateData", State}]}]; + {essl, _} -> + %% Do not print ssl options in superviosr reports + [{data, [{"StateData", + State#state{mod = Mod#mod{socket_type = 'TLS'}}}]}] + end. %%-------------------------------------------------------------------- %% code_change(OldVsn, State, Extra) -> {ok, NewState} |