Changeset

4888:dc7c9ae15f43

mod_rest: Ensure mod_http is loaded before API demo Fixes an error as it tried to use module:http_url() which doesn't exist before mod_http is loaded
author Kim Alvefur <zash@zash.se>
date Tue, 08 Feb 2022 13:51:41 +0100
parents 4887:806f7c8d830b
children 4889:52522c71ad1a
files mod_rest/mod_rest.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_rest/mod_rest.lua	Mon Feb 07 16:52:19 2022 +0100
+++ b/mod_rest/mod_rest.lua	Tue Feb 08 13:51:41 2022 +0100
@@ -384,13 +384,14 @@
 	end
 end
 
+module:depends("http");
+
 local demo_handlers = {};
 if module:get_option_path("rest_demo_resources", nil) then
 	demo_handlers = module:require"apidemo";
 end
 
 -- Handle stanzas submitted via HTTP
-module:depends("http");
 module:provides("http", {
 		route = {
 			POST = handle_request;