Changeset

358:4483bb889d12

mod_register_json: Minor refactor, default to port 9280 if option is unspecified or default to port 9443 if SSL is used. (Good, bad?)
author Marco Cirillo <maranda@lightwitch.org>
date Tue, 12 Apr 2011 17:47:47 +0000
parents 357:59345fd38ad9
children 359:5d22ebcb9ec5
files mod_register_json/mod_register_json.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_register_json/mod_register_json.lua	Tue Apr 12 17:13:38 2011 +0000
+++ b/mod_register_json/mod_register_json.lua	Tue Apr 12 17:47:47 2011 +0000
@@ -63,13 +63,14 @@
 end
 
 local function setup()
-        local ports = module:get_option("reg_servlet_port") or { 9443 };
+        local ports = module:get_option("reg_servlet_port") or { 9280 };
         local base_name = module:get_option("reg_servlet_base") or "register_account";
         local ssl_cert = module:get_option("reg_servlet_sslcert") or false;
         local ssl_key = module:get_option("reg_servlet_sslkey") or false;
         if not ssl_cert or not ssl_key then
         	require "net.httpserver".new_from_config(ports, handle_req, { base = base_name });
         else
+        	if module:get_option("reg_servlet_port") == nil then ports = { 9443 }; end
         	require "net.httpserver".new_from_config(ports, handle_req, { ssl = { key = ssl_key, certificate = ssl_cert }, base = base_name });
 	end
 end