Software /
code /
prosody
Comparison
plugins/mod_http.lua @ 13140:7a6874f9fd40
mod_http: Simplify conversion of Set to Array
Avoids the _items semi-private value, that is used everywhere for some
reason.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 10 Jun 2023 12:18:09 +0200 |
parent | 13127:f45a29b32f7a |
child | 13141:451cb119026e |
comparison
equal
deleted
inserted
replaced
13137:b417a49cc31b | 13140:7a6874f9fd40 |
---|---|
113 end | 113 end |
114 return "http://disabled.invalid/"; | 114 return "http://disabled.invalid/"; |
115 end | 115 end |
116 | 116 |
117 local function header_set_tostring(header_value) | 117 local function header_set_tostring(header_value) |
118 return array(pairs(header_value._items)):concat(", "); | 118 return array(header_value:items()):concat(", "); |
119 end | 119 end |
120 | 120 |
121 local function apply_cors_headers(response, methods, headers, max_age, allow_credentials, allowed_origins, origin) | 121 local function apply_cors_headers(response, methods, headers, max_age, allow_credentials, allowed_origins, origin) |
122 if allowed_origins and not allowed_origins[origin] then | 122 if allowed_origins and not allowed_origins[origin] then |
123 return; | 123 return; |