webmcp
changeset 227:703808418543
Added missing request.get_path() function
author | jbe |
---|---|
date | Fri Feb 27 22:33:07 2015 +0100 (2015-02-27) |
parents | 17baf126ea88 |
children | bcf6ddd2cd1a |
files | framework/env/request/get_path.lua |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/framework/env/request/get_path.lua Fri Feb 27 22:33:07 2015 +0100 1.3 @@ -0,0 +1,15 @@ 1.4 +--[[-- 1.5 +path = 1.6 +request.get_path() 1.7 + 1.8 +Returns the path in the URL of the request. 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 +end