mirror of
https://gitgud.io/fatchan/haproxy-protection.git
synced 2025-05-09 02:05:37 +00:00
Fix issue with pplet.qs taking whole query but not parsing the path out of it for the map loopup, caused issues with selecting captcha mode
This commit is contained in:
@@ -394,7 +394,6 @@ function M.parse(url)
|
||||
M.setAuthority(comp, v)
|
||||
return ''
|
||||
end)
|
||||
|
||||
comp.path = url:gsub("([^/]+)", function (s) return encode(decode(s), M.options.legal_in_path) end)
|
||||
|
||||
setmetatable(comp, {
|
||||
@@ -406,6 +405,15 @@ function M.parse(url)
|
||||
return comp
|
||||
end
|
||||
|
||||
--- Parse and return just the path from applet.qs
|
||||
-- @param qs string
|
||||
-- @return path string
|
||||
function M.getpath(qs)
|
||||
qs = qs:gsub('%?(.*)', '')
|
||||
local path = qs:gsub("([^/]+)", function (s) return encode(decode(s), M.options.legal_in_path) end)
|
||||
return path or ""
|
||||
end
|
||||
|
||||
--- removes dots and slashes in urls when possible
|
||||
-- This function will also remove multiple slashes
|
||||
-- @param path The string representing the path to clean
|
||||
|
Reference in New Issue
Block a user