# HG changeset patch # User Kim Alvefur # Date 1686393238 -7200 # Node ID 5d5869f14c4de5231be0264098a6232ab44957d2 # Parent 0b0cefce6e4207f30d116fad30ad3ff90ca22467 mod_http: Fix error if 'access_control_allow_origins' is set Because it changes the type of the 'opt_origins' variable from util.set to the internal _items table so next time an http app is added an error "attempt to call a nil value (method 'empty')" is triggered. The value is not used anywhere else. Noticed when reviewing uses of the '_items' set property. Not reported by any users, implying this setting is rarely used. diff -r 0b0cefce6e42 -r 5d5869f14c4d plugins/mod_http.lua --- a/plugins/mod_http.lua Sat Jun 10 12:14:12 2023 +0200 +++ b/plugins/mod_http.lua Sat Jun 10 12:33:58 2023 +0200 @@ -149,7 +149,7 @@ local app_credentials = opt_credentials; local app_origins; if opt_origins and not (opt_origins:empty() or opt_origins:contains("*")) then - opt_origins = opt_origins._items; + app_origins = opt_origins._items; end local function cors_handler(event_data)