webmcp
annotate framework/env/request/get_path.lua @ 236:4ab91adeab6f
Added local variable declarations in request/default_router.lua
| author | jbe | 
|---|---|
| date | Sat Feb 28 23:37:27 2015 +0100 (2015-02-28) | 
| parents | 703808418543 | 
| children | 3db6f3ad0703 | 
| rev | line source | 
|---|---|
| jbe@227 | 1 --[[-- | 
| jbe@227 | 2 path = | 
| jbe@227 | 3 request.get_path() | 
| jbe@227 | 4 | 
| jbe@227 | 5 Returns the path in the URL of the request. | 
| jbe@227 | 6 | 
| jbe@227 | 7 --]]-- | 
| jbe@227 | 8 | 
| jbe@227 | 9 function request.get_path() | 
| jbe@227 | 10 local path = request._http_request.path | 
| jbe@227 | 11 if not path then | 
| jbe@227 | 12 error("No valid path for HTTP request") | 
| jbe@227 | 13 end | 
| jbe@227 | 14 return path | 
| jbe@227 | 15 end |