-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Labels
bugIssue is reported as a bugIssue is reported as a bugteam:PSAssigned to OTP team PSAssigned to OTP team PS
Description
Describe the bug
otp/lib/inets/src/http_server/httpd.erl
Line 874 in a4d5b23
| Body :: iolist() | nobody | {Fun, FunArg}, |
nobody atom is a possible value for Body. Despite this fact, an 500 Internal Server Error occurs and body consists of fallback HTML.
To Reproduce
-module(my_mod).
-export([do/1]).
do(_) ->
{break, [{response, {401, nobody}}]}.
-module(a).
-behaviour(application).
-export([start/2, stop/1]).
start(_, _) ->
inets:start(),
{ok, Pid} =
inets:start(
httpd,
[
{port, 8080},
{server_root, "."},
{document_root, "."},
{bind_address, "localhost"},
{modules, [
mod_alias,
mod_auth,
my_mod,
mod_esi,
mod_actions,
mod_cgi,
mod_get,
mod_head,
mod_log,
mod_disk_log
]}
]
),
{ok, Pid}.
stop(Server) ->
ok = inets:stop(httpd, Server).
And start with:
erlc a.erl my_mod.erl && erl -noinput -eval 'a:start(0, 0).'
Expected behavior
A response with status code 401 and empty body is sent back.
Affected versions
Erlang/OTP 28 [erts-16.1.1].
Additional context
No additional context.
Metadata
Metadata
Assignees
Labels
bugIssue is reported as a bugIssue is reported as a bugteam:PSAssigned to OTP team PSAssigned to OTP team PS