aboutsummaryrefslogtreecommitdiffstats
path: root/rules/controller
diff options
context:
space:
mode:
Diffstat (limited to 'rules/controller')
-rw-r--r--rules/controller/maps.lua17
1 files changed, 16 insertions, 1 deletions
diff --git a/rules/controller/maps.lua b/rules/controller/maps.lua
index 42d761172..ec2392d56 100644
--- a/rules/controller/maps.lua
+++ b/rules/controller/maps.lua
@@ -47,8 +47,23 @@ end
local function handle_query_map(_, conn, req_params)
maybe_fill_maps_cache()
if req_params.value and req_params.value ~= '' then
+ local results = {}
+ for uri,m in pairs(maps_cache) do
+ local value = m:get_key(req_params.value)
- conn:send_ucl({success = false and true})
+ if value then
+ local result = {
+ map = uri,
+ alias = uri:match('/([^/]+)$'),
+ value = value
+ }
+ table.insert(results, result)
+ end
+ end
+ conn:send_ucl{
+ success = (#results > 0),
+ results = results
+ }
else
conn:send_error(404, 'missing value')
end