Mercurial > prosody-hg
comparison util/sslconfig.lua @ 13913:2f754817bf4b 13.0
util.sslconfig: Fix error when applying ssl={[port]=...}
An error due to the key being numeric and thus not having the meta-methods
Introduced in 2ee27587fec7
Fixes #1948
Thanks Andronicus
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 14 Jul 2025 16:42:59 +0200 |
| parents | 61da4491eebc |
| children |
comparison
equal
deleted
inserted
replaced
| 13896:17b5a10bd9c9 | 13913:2f754817bf4b |
|---|---|
| 118 local function apply(config, new) | 118 local function apply(config, new) |
| 119 rawset(config, "_cache", nil); | 119 rawset(config, "_cache", nil); |
| 120 if type(new) == "table" then | 120 if type(new) == "table" then |
| 121 for field, value in pairs(new) do | 121 for field, value in pairs(new) do |
| 122 -- exclude keys which are internal to the config builder | 122 -- exclude keys which are internal to the config builder |
| 123 if field:sub(1, 1) ~= "_" then | 123 if type(field) == "string" and field:sub(1, 1) ~= "_" then |
| 124 (handlers[field] or rawset)(config, field, value); | 124 (handlers[field] or rawset)(config, field, value); |
| 125 end | 125 end |
| 126 end | 126 end |
| 127 end | 127 end |
| 128 return config | 128 return config |
