# HG changeset patch # User Kim Alvefur # Date 1577893038 -3600 # Node ID 1a0a612d36bc43b39934bc69aa2bd72896263b02 # Parent 0dede5b0ab2708bdfd3997cd15ac7081c489b1fe mod_rest: Short-circuit type selection if accept header diff -r 0dede5b0ab27 -r 1a0a612d36bc mod_rest/mod_rest.lua --- 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];