webmcp

diff framework/env/request/process.lua @ 221:25a20bd1f416

More work on Moonbridge integration: several changes in env/request
author jbe
date Wed Feb 25 01:33:27 2015 +0100 (2015-02-25)
parents fd0360594636
children 38e5399718ca
line diff
     1.1 --- a/framework/env/request/process.lua	Sun Feb 22 17:16:13 2015 +0100
     1.2 +++ b/framework/env/request/process.lua	Wed Feb 25 01:33:27 2015 +0100
     1.3 @@ -10,7 +10,7 @@
     1.4    end
     1.5  end
     1.6  
     1.7 -function request.process(route)
     1.8 +function request.process()
     1.9  
    1.10    local success, error_info = xpcall(
    1.11      function()
    1.12 @@ -23,15 +23,7 @@
    1.13          if blob then slot.restore_all(blob) end
    1.14        end
    1.15  
    1.16 -
    1.17 -      if request.is_404() then
    1.18 -        request.set_status("404 Not Found")
    1.19 -        if request.get_404_route() then
    1.20 -          request.forward(request.get_404_route())
    1.21 -        else
    1.22 -          error("No 404 page set.")
    1.23 -        end
    1.24 -      elseif request.get_action() then
    1.25 +      if request.get_action() then
    1.26          trace.request{
    1.27            module = request.get_module(),
    1.28            action = request.get_action()
    1.29 @@ -48,9 +40,9 @@
    1.30            request.set_status("404 Not Found")
    1.31            request.forward(request.get_404_route())
    1.32          else
    1.33 -          if cgi.method ~= "POST" then
    1.34 +          if request._http_request.method ~= "POST" then
    1.35              request.set_status("405 Method Not Allowed")
    1.36 -            cgi.add_header("Allow: POST")
    1.37 +            request.add_header("Allow", "POST")
    1.38              error("Tried to invoke an action with a GET request.")
    1.39            end
    1.40            local action_status = execute.filtered_action{

Impressum / About Us