changeset 3815:1a0a612d36bc

mod_rest: Short-circuit type selection if accept header
author Kim Alvefur <zash@zash.se>
date Wed, 01 Jan 2020 16:37:18 +0100
parents 0dede5b0ab27
children 8473fd2d09c1
files mod_rest/mod_rest.lua
diffstat 1 files changed, 0 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mod_rest/mod_rest.lua	Wed Jan 01 16:35:55 2020 +0100
+++ b/mod_rest/mod_rest.lua	Wed Jan 01 16:37:18 2020 +0100
@@ -45,9 +45,6 @@
 local function decide_type(accept)
 	-- assumes the accept header is sorted
 	local ret = supported_types[1];
-	if not accept then
-		return ret;
-	end
 	for i = 2, #supported_types do
 		if (accept:find(supported_types[i], 1, true) or 1000) < (accept:find(ret, 1, true) or 1000) then
 			ret = supported_types[i];