diff --git a/src/nova_plugin_handler.erl b/src/nova_plugin_handler.erl index ae532f8..0becaa3 100644 --- a/src/nova_plugin_handler.erl +++ b/src/nova_plugin_handler.erl @@ -52,6 +52,9 @@ run_plugins([{Callback, Options}|Tl], CallbackType, Req, Env) when is_function(C {stop, Req0}; {stop, Reply, Req0, _State0} -> Req1 = handle_reply(Reply, Req0), + %% Since we are stopping we need to send the statuscode to the requester. This is a special case for stop. + StatusCode = maps:get(resp_status_code, Req1, 200), + cowboy_req:reply(StatusCode, Req1), {stop, Req1} end catch