# HG changeset patch # User jbe # Date 1349887271 -7200 # Node ID db4bf2e6513c659f83c4543dcb17977d8f939635 # Parent df9a192d36d530766351034d5d45b0c6cf342cc2 Fixed errors in sample webserver configurations and request/__init.lua diff -r df9a192d36d5 -r db4bf2e6513c doc/apache.sample.conf --- a/doc/apache.sample.conf Wed Oct 10 18:29:08 2012 +0200 +++ b/doc/apache.sample.conf Wed Oct 10 18:41:11 2012 +0200 @@ -5,7 +5,7 @@ # do not rewrite static URLs RewriteRule ^/webmcp-demo/static/(.*)$ /webmcp-demo/static/$1 # dynamic URLs -RewriteRule ^/webmcp-demo/([^\?]+)/(\?(.*))?$ /webmcp-demo/webmcp-wrapper.lua?_webmcp_path=$1&$2 +RewriteRule ^/webmcp-demo/([^\?]*)(\?(.*))?$ /webmcp-demo/webmcp-wrapper.lua?_webmcp_path=$1&$2 # Directly serve static files Alias /webmcp-demo/static /__INSERT_LOCAL_FILE_PATH_TO_DEMO_APPLICATION_HERE__/static diff -r df9a192d36d5 -r db4bf2e6513c doc/lighttpd.sample.conf --- a/doc/lighttpd.sample.conf Wed Oct 10 18:29:08 2012 +0200 +++ b/doc/lighttpd.sample.conf Wed Oct 10 18:41:11 2012 +0200 @@ -30,7 +30,7 @@ "/webmcp-demo/static/$1", # dynamic URLs - "^/webmcp-demo/([^\?])(\?(.*))?$" => + "^/webmcp-demo/([^\?]*)(\?(.*))?$" => "/webmcp-demo/webmcp-wrapper.lua?_webmcp_path=$1&$2", ) diff -r df9a192d36d5 -r db4bf2e6513c framework/env/request/__init.lua --- a/framework/env/request/__init.lua Wed Oct 10 18:29:08 2012 +0200 +++ b/framework/env/request/__init.lua Wed Oct 10 18:41:11 2012 +0200 @@ -25,6 +25,7 @@ request._module = "index" request._view = "index" depth = 0 + return end module = string.match(path, "^([^/]+)/$") if module then @@ -65,8 +66,8 @@ request._view = cgi.params._webmcp_view request._suffix = cgi.params._webmcp_suffix request._id = cgi.params._webmcp_id + depth = tonumber(cgi.params._webmcp_urldepth) end - depth = tonumber(cgi.params._webmcp_urldepth) end if depth and depth > 0 then local elements = {}