summaryrefslogtreecommitdiffstats
path: root/debian/perl-framework/t/htdocs/modules/lua/translate.lua
blob: 7d19c9a4daee3fde81f6ac33c80c2fdca9164448 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require 'apache2'

function translate_name(r)
    r:debug("translate_name: " .. r.uri) 
    local query = r:parseargs()
    if query.translateme then
        r:debug("translate_name: translateme  was true " .. r.uri) 
        r.uri = "/modules/lua/hello.lua"
        return apache2.DECLINED
    end
    return apache2.DECLINED
end

function translate_name2(r)
    r:debug("translate_name2: " .. r.uri) 
    local query = r:parseargs()
    if (query.ok) then
        r:debug("will return OK")
    end
    if query.translateme then
        r.uri = "/modules/lua/hello2.lua"
        if query.ok then
	  r.filename= r.document_root .. r.uri
          return apache2.OK
        end
    end
    return apache2.DECLINED
end