webmcp
diff framework/env/request/process.lua @ 222:38e5399718ca
Use request.get_param{...} and request.get_param_strings{...} functions in request.process()
author | jbe |
---|---|
date | Fri Feb 27 17:18:08 2015 +0100 (2015-02-27) |
parents | 25a20bd1f416 |
children | 32ec28229bb5 |
line diff
1.1 --- a/framework/env/request/process.lua Wed Feb 25 01:33:27 2015 +0100 1.2 +++ b/framework/env/request/process.lua Fri Feb 27 17:18:08 2015 +0100 1.3 @@ -16,7 +16,7 @@ 1.4 function() 1.5 1.6 -- restore slots if coming from http redirect 1.7 - local tempstore_value = request.get_param{method = "GET", name = "_tempstore"} 1.8 + local tempstore_value = request._http_request.get_params["_tempstore"] 1.9 if tempstore_value then 1.10 trace.restore_slots{} 1.11 local blob = tempstore.pop(tempstore_value) 1.12 @@ -51,22 +51,22 @@ 1.13 } 1.14 if not request.is_rerouted() then 1.15 local routing_mode, routing_module, routing_view 1.16 - routing_mode = cgi.params["_webmcp_routing." .. action_status .. ".mode"] 1.17 - routing_module = cgi.params["_webmcp_routing." .. action_status .. ".module"] 1.18 - routing_view = cgi.params["_webmcp_routing." .. action_status .. ".view"] 1.19 - routing_anchor = cgi.params["_webmcp_routing." .. action_status .. ".anchor"] 1.20 + routing_mode = request._http_request.post_params["_webmcp_routing." .. action_status .. ".mode"] 1.21 + routing_module = request._http_request.post_params["_webmcp_routing." .. action_status .. ".module"] 1.22 + routing_view = request._http_request.post_params["_webmcp_routing." .. action_status .. ".view"] 1.23 + routing_anchor = request._http_request.post_params["_webmcp_routing." .. action_status .. ".anchor"] 1.24 if not (routing_mode or routing_module or routing_view) then 1.25 action_status = "default" 1.26 - routing_mode = cgi.params["_webmcp_routing.default.mode"] 1.27 - routing_module = cgi.params["_webmcp_routing.default.module"] 1.28 - routing_view = cgi.params["_webmcp_routing.default.view"] 1.29 - routing_anchor = cgi.params["_webmcp_routing.default.anchor"] 1.30 + routing_mode = request._http_request.post_params["_webmcp_routing.default.mode"] 1.31 + routing_module = request._http_request.post_params["_webmcp_routing.default.module"] 1.32 + routing_view = request._http_request.post_params["_webmcp_routing.default.view"] 1.33 + routing_anchor = request._http_request.post_params["_webmcp_routing.default.anchor"] 1.34 end 1.35 assert(routing_module, "Routing information has no module.") 1.36 assert(routing_view, "Routing information has no view.") 1.37 if routing_mode == "redirect" then 1.38 local routing_params = {} 1.39 - for key, value in pairs(cgi.params) do 1.40 + for key, value in request.get_param_strings{method="POST", include_internal=true} do 1.41 local status, stripped_key = string.match( 1.42 key, "^_webmcp_routing%.([^%.]*)%.params%.(.*)$" 1.43 ) 1.44 @@ -77,7 +77,7 @@ 1.45 request.redirect{ 1.46 module = routing_module, 1.47 view = routing_view, 1.48 - id = cgi.params["_webmcp_routing." .. action_status .. ".id"], 1.49 + id = request._http_request.post_params["_webmcp_routing." .. action_status .. ".id"], 1.50 params = routing_params, 1.51 anchor = routing_anchor 1.52 }