Changeset

651:78a23a7dc613

mod_register_json: fixed typo, added https/http switch and default value to it.
author Marco Cirillo <maranda@lightwitch.org>
date Sun, 29 Apr 2012 13:44:21 +0000
parents 650:34e7093cf419
children 652:3e6f43ab7e22
files mod_register_json/mod_register_json.lua
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_register_json/mod_register_json.lua	Sun Apr 29 13:06:53 2012 +0000
+++ b/mod_register_json/mod_register_json.lua	Sun Apr 29 13:44:21 2012 +0000
@@ -17,6 +17,7 @@
 
 -- Pick up configuration.
 
+local secure = module:get_option_boolean("reg_servlet_secure", true)
 local set_realm_name = module:get_option_string("reg_servlet_realm", "Restricted")
 local base_path = module:get_option_string("reg_servlet_base", "/register_account/")
 local throttle_time = module:get_option_number("reg_servlet_ttime", nil)
@@ -108,7 +109,7 @@
 						return http_response(event, 200, "Done.")
 					else
 						module:log("error", "user creation failed: "..error)
-						return http_response(event 500, "Encountered server error while creating the user: "..error)
+						return http_response(event, 500, "Encountered server error while creating the user: "..error)
 					end
 				end
 			else
@@ -121,7 +122,7 @@
 
 -- Set it up!
 
-module:provides("http", {
+module:provides((secure and "https" or "http"), {
 	default_path = base_path,
         route = {
                 ["GET /"] = handle_req,