comparison mod_rest/mod_rest.lua @ 4745:d29a295cd165

mod_rest: Let 'type' be implied in path based queries This will make e.g. MAM queries work via GET /archive/{to}
author Kim Alvefur <zash@zash.se>
date Thu, 04 Nov 2021 20:15:44 +0100
parents 2bc5a0c0d8c3
children f69c5a443156
comparison
equal deleted inserted replaced
4744:f478855f4565 4745:d29a295cd165
108 if not st_kind then return; end 108 if not st_kind then return; end
109 if st_kind == "iq" and st_type ~= "get" and st_type ~= "set" then 109 if st_kind == "iq" and st_type ~= "get" and st_type ~= "set" then
110 -- GET /iq/disco/jid 110 -- GET /iq/disco/jid
111 data = { 111 data = {
112 kind = "iq"; 112 kind = "iq";
113 type = "get";
114 [st_type] = st_type == "ping" or data or {}; 113 [st_type] = st_type == "ping" or data or {};
115 }; 114 };
116 else 115 else
117 data.kind = st_kind; 116 data.kind = st_kind;
118 data.type = st_type; 117 data.type = st_type;