Skip to content

Commit

Permalink
Make set_application_path() simple again (compat fix for apache-win)
Browse files Browse the repository at this point in the history
  • Loading branch information
felipedaragon committed Oct 10, 2015
1 parent ec05847 commit d1bc6fb
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/sailor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,10 @@ function sailor.handle_request(r)
return sailor.route(page)
end

function sailor.get_filename_path(r)
local filename = r.uri:match( "([^/]+)$")
return r.filename:match("^@?(.-)/"..filename.."$")
end

-- Stores the path of the application in sailor.path
function sailor.set_application_path(r)
if sailor.remy_mode ~= nil then
sailor.path = sailor.get_filename_path(r)
else
local dir = lfs.currentdir()
if dir == '/' or not dir then
sailor.path = sailor.get_filename_path(r)
else
sailor.path = dir
end
end
local filename = r.uri:match( "([^/]+)$")
sailor.path = r.filename:match("^@?(.-)/"..filename.."$")
end

-- Encapsulates request_rec functions inside the Page object
Expand Down

0 comments on commit d1bc6fb

Please sign in to comment.