webmcp

changeset 241:3db6f3ad0703

Allow illegal routes
author jbe
date Sun Mar 01 01:29:03 2015 +0100 (2015-03-01)
parents bcb3aed3a71e
children f66037207da8
files framework/env/request/get_path.lua framework/env/request/handler.lua
line diff
     1.1 --- a/framework/env/request/get_path.lua	Sun Mar 01 00:12:48 2015 +0100
     1.2 +++ b/framework/env/request/get_path.lua	Sun Mar 01 01:29:03 2015 +0100
     1.3 @@ -2,14 +2,10 @@
     1.4  path =
     1.5  request.get_path()
     1.6  
     1.7 -Returns the path in the URL of the request.
     1.8 +Returns the path in the URL of the request. May return nil for a HTTP OPTIONS request with "*" target.
     1.9  
    1.10  --]]--
    1.11  
    1.12  function request.get_path()
    1.13 -  local path = request._http_request.path
    1.14 -  if not path then
    1.15 -    error("No valid path for HTTP request")
    1.16 -  end
    1.17 -  return path
    1.18 +  return request._http_request.path
    1.19  end
     2.1 --- a/framework/env/request/handler.lua	Sun Mar 01 00:12:48 2015 +0100
     2.2 +++ b/framework/env/request/handler.lua	Sun Mar 01 01:29:03 2015 +0100
     2.3 @@ -19,7 +19,7 @@
     2.4    else
     2.5      request._relative_baseurl = nil
     2.6    end
     2.7 -  request._route = request.router()
     2.8 +  request._route = request.router() or {}
     2.9    request.process()
    2.10  end
    2.11  

Impressum / About Us