Diff

mod_rest/mod_rest.lua @ 3825:802087d3155a

mod_rest: Fix traceback on missing content-type header
author Kim Alvefur <zash@zash.se>
date Thu, 02 Jan 2020 09:59:31 +0100
parent 3824:a0b8ec44a36b
child 3832:0d4146cf9fbc
line wrap: on
line diff
--- a/mod_rest/mod_rest.lua	Thu Jan 02 09:57:49 2020 +0100
+++ b/mod_rest/mod_rest.lua	Thu Jan 02 09:59:31 2020 +0100
@@ -25,7 +25,7 @@
 end
 
 local function parse(mimetype, data)
-	mimetype = mimetype:match("^[^; ]*");
+	mimetype = mimetype and mimetype:match("^[^; ]*");
 	if mimetype == "application/xmpp+xml" then
 		return xml.parse(data);
 	elseif mimetype == "application/json" then