Packages
nova
0.13.1
0.15.1
0.14.3
0.14.1
0.13.7
0.13.1
0.13.0
0.12.1
0.12.0
0.11.0
0.10.4
0.10.3
0.10.2
0.10.1
0.10.0
0.9.24
0.9.23
0.9.22
0.9.21
0.9.20
0.9.19
0.9.18
0.9.17
0.9.16
0.9.15
0.9.11
0.9.5
0.9.4
0.9.3
0.9.2
0.9.1
0.9.0
0.8.6
0.8.5
0.8.4
0.8.3
0.8.2
0.8.1
0.8.0
0.7.2
0.7.1
0.7.0
0.6.2
0.6.1
0.6.0
0.5.2
0.5.1
0.4.4
0.4.3
0.4.2
0.4.1
0.2.2
0.1.0
0.0.1
0.0.0
Nova is a web application framework
Current section
54 Versions
Jump to
Current section
54 Versions
Compare versions
5
files changed
+16
additions
-6
deletions
| @@ -46,4 +46,4 @@ | |
| 46 46 | [{<<"app">>,<<"thoas">>}, |
| 47 47 | {<<"optional">>,false}, |
| 48 48 | {<<"requirement">>,<<"1.2.1">>}]}]}. |
| 49 | - {<<"version">>,<<"0.13.0">>}. |
| 49 | + {<<"version">>,<<"0.13.1">>}. |
| @@ -1,6 +1,6 @@ | |
| 1 1 | {application,nova, |
| 2 2 | [{description,"Nova is a web application framework"}, |
| 3 | - {vsn,"0.13.0"}, |
| 3 | + {vsn,"0.13.1"}, |
| 4 4 | {registered,[]}, |
| 5 5 | {mod,{nova_app,[]}}, |
| 6 6 | {included_applications,[]}, |
| @@ -52,6 +52,9 @@ run_plugins([{Callback, Options}|Tl], CallbackType, Req, Env) when is_function(C | |
| 52 52 | {stop, Req0}; |
| 53 53 | {stop, Reply, Req0, _State0} -> |
| 54 54 | Req1 = handle_reply(Reply, Req0), |
| 55 | + %% Since we are stopping we need to send the statuscode to the requester. This is a special case for stop. |
| 56 | + StatusCode = maps:get(resp_status_code, Req1, 200), |
| 57 | + cowboy_req:reply(StatusCode, Req1), |
| 55 58 | {stop, Req1} |
| 56 59 | end |
| 57 60 | catch |
| @@ -72,7 +72,10 @@ start_link() -> | |
| 72 72 | add_plugin({_Class, Module, _Opts}) -> |
| 73 73 | add_plugin(Module); |
| 74 74 | add_plugin(Module) when is_atom(Module) -> |
| 75 | - #{title := Title, version := Version} = Module:plugin_info(), |
| 75 | + #{title := Title, version := Version} = case Module:plugin_info() of |
| 76 | + {Title0, Version0, _, _, _} -> #{title => Title0, version => Version0}; |
| 77 | + PluginInfo -> PluginInfo |
| 78 | + end, |
| 76 79 | add_plugin(Module, Title, Version); |
| 77 80 | add_plugin(Callback) when is_function(Callback) -> |
| 78 81 | Info = erlang:fun_info(Callback), |
| @@ -71,10 +71,14 @@ init([]) -> | |
| 71 71 | child(nova_plugin_manager, nova_plugin_manager), |
| 72 72 | child(nova_watcher, nova_watcher) |
| 73 73 | ], |
| 74 | + |
| 75 | + %% try to ensure callback module is loaded first |
| 76 | + ExportedFuns = SessionManager:module_info(exports), |
| 77 | + |
| 74 78 | Children = |
| 75 | - case erlang:function_exported(SessionManager, start_link, 0) of |
| 76 | - true -> [child(SessionManager, SessionManager) | Children0]; |
| 77 | - false -> Children0 |
| 79 | + case proplists:get_value(start_link, ExportedFuns) of |
| 80 | + 0 -> [child(SessionManager, SessionManager) | Children0]; |
| 81 | + _ -> Children0 |
| 78 82 | end, |
| 79 83 | |
| 80 84 | setup_cowboy(Configuration), |