Mercurial > prosody-modules
comparison mod_rest/mod_rest.lua @ 4480:dad0367d33e8
mod_rest: Revert leftover of unfinished ?query mapping
Idea was to allow second level data fields to be passed as query
parameters, i.e. /rest/command/{to}/?command=execute&node=foobar but
that's still a work in progress, so reverted here for now.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 28 Feb 2021 20:59:53 +0100 |
parents | 7ab0c423688a |
children | e453eaf1589e |
comparison
equal
deleted
inserted
replaced
4479:356b5ad521a5 | 4480:dad0367d33e8 |
---|---|
63 local function amend_from_path(data, path) | 63 local function amend_from_path(data, path) |
64 local st_kind, st_type, st_to = path:match("^([mpi]%w+)/(%w+)/(.*)$"); | 64 local st_kind, st_type, st_to = path:match("^([mpi]%w+)/(%w+)/(.*)$"); |
65 if not st_kind then return; end | 65 if not st_kind then return; end |
66 if st_kind == "iq" and st_type ~= "get" and st_type ~= "set" then | 66 if st_kind == "iq" and st_type ~= "get" and st_type ~= "set" then |
67 -- GET /iq/disco/jid | 67 -- GET /iq/disco/jid |
68 data = { | 68 data.kind = "iq"; |
69 kind = "iq"; | 69 data.type = "get"; |
70 type = "get"; | 70 data.[st_type] = true; |
71 [st_type] = data; | |
72 } | |
73 else | 71 else |
74 data.kind = st_kind; | 72 data.kind = st_kind; |
75 data.type = st_type; | 73 data.type = st_type; |
76 end | 74 end |
77 if st_to and st_to ~= "" then | 75 if st_to and st_to ~= "" then |