diff options
author | Daniel Gruno <humbedooh@apache.org> | 2012-08-01 22:13:04 +0200 |
---|---|---|
committer | Daniel Gruno <humbedooh@apache.org> | 2012-08-01 22:13:04 +0200 |
commit | a9767564418132be5802a4c71917253ed77a7b1d (patch) | |
tree | e4730c79636d9492ccc2f426d2fa5be136eb56fa /docs/manual/mod/mod_lua.xml | |
parent | Fix up some contradictory contexts (diff) | |
download | apache2-a9767564418132be5802a4c71917253ed77a7b1d.tar.xz apache2-a9767564418132be5802a4c71917253ed77a7b1d.zip |
Add some info about what LuaHookTypeChecker could be used for (other ideas are most welcome)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1368232 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | docs/manual/mod/mod_lua.xml | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/docs/manual/mod/mod_lua.xml b/docs/manual/mod/mod_lua.xml index 768531f242..ef6270942f 100644 --- a/docs/manual/mod/mod_lua.xml +++ b/docs/manual/mod/mod_lua.xml @@ -779,7 +779,27 @@ end <context>directory</context><context>.htaccess</context> </contextlist> <override>All</override> - <usage><p>...</p></usage> + <usage><p> + This directive provides a hook for the type_checker phase of the request processing. + This phase is where requests are assigned a content type and a handler, and thus can + be used to modify the type and handler based on input: + </p> + <highlight language="config"> + LuaHookTypeChecker /path/to/lua/script.lua type_checker + </highlight> + <highlight language="lua"> + function type_checker(r) + if r.uri:match("%.to_gif$") then -- match foo.png.to_gif + r.content_type = "image/gif" -- assign it the image/gif type + r.handler = "gifWizard" -- tell the gifWizard module to handle this + r.filename = r.uri:gsub("%.to_gif$", "") -- fix the filename requested + return apache2.OK + end + + return apache2.DECLINED + end + </highlight> +</usage> </directivesynopsis> <directivesynopsis> |