comparison mod_rest/mod_rest.lua @ 3924:88d0f7438f0e

mod_rest: Spred array over multiple lines for nicer future diffs
author Kim Alvefur <zash@zash.se>
date Fri, 28 Feb 2020 22:39:42 +0100
parents 80dffbbd056b
children 7dec5d096bb8
comparison
equal deleted inserted replaced
3923:3c3d216c6f6d 3924:88d0f7438f0e
81 return st.message({ type = "chat" }, data); 81 return st.message({ type = "chat" }, data);
82 end 82 end
83 return nil, "unknown-payload-type"; 83 return nil, "unknown-payload-type";
84 end 84 end
85 85
86 local supported_types = { "application/xmpp+xml", "application/json", "application/x-www-form-urlencoded" }; 86 local supported_types = {
87 "application/xmpp+xml",
88 "application/json",
89 "application/x-www-form-urlencoded",
90 };
87 91
88 local function decide_type(accept) 92 local function decide_type(accept)
89 -- assumes the accept header is sorted 93 -- assumes the accept header is sorted
90 local ret = supported_types[1]; 94 local ret = supported_types[1];
91 for i = 2, #supported_types do 95 for i = 2, #supported_types do