webmcp
annotate framework/env/request/get_absolute_baseurl.lua @ 28:ea2e8f3a2776
allow webmcp path to be set in cgi script
this allows another script to include the webmcp script when the cwd is not the cgi-bin. the script needs to set the WEBMCP_PATH variable.
this allows another script to include the webmcp script when the cwd is not the cgi-bin. the script needs to set the WEBMCP_PATH variable.
author | Daniel Poelzleithner <poelzi@poelzi.org> |
---|---|
date | Sun Sep 19 01:36:08 2010 +0200 (2010-09-19) |
parents | 944642a3e488 |
children | 2169a62e12f5 |
rev | line source |
---|---|
jbe/bsw@16 | 1 --[[-- |
jbe/bsw@16 | 2 baseurl = |
jbe/bsw@16 | 3 request.get_absolute_baseurl() |
jbe/bsw@16 | 4 |
jbe/bsw@16 | 5 This function returns the absolute base URL of the application, as set by request.set_absolute_baseurl(...). |
jbe/bsw@16 | 6 |
jbe/bsw@16 | 7 --]]-- |
jbe/bsw@16 | 8 |
jbe/bsw@0 | 9 function request.get_absolute_baseurl() |
jbe/bsw@0 | 10 if request._absolute_baseurl then |
jbe/bsw@0 | 11 return request._absolute_baseurl |
jbe/bsw@0 | 12 else |
jbe/bsw@0 | 13 error("Absolute base URL is unknown. It should be set in the configuration by calling request.set_absolute_baseurl(...).") |
jbe/bsw@0 | 14 end |
jbe/bsw@0 | 15 end |