Changeset

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
parents 3824:a0b8ec44a36b
children 3826:21ffca4d3aae
files mod_rest/mod_rest.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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