aboutsummaryrefslogtreecommitdiff
path: root/src/headers.lua
diff options
context:
space:
mode:
authorThijs Schreijer <thijs@thijsschreijer.nl>2026-08-29 20:05:00 +0200
committerGitHub <noreply@github.com>2026-08-29 20:05:00 +0200
commit3dd5fb0468977c6626fe4a0ea7b95222f14da09f (patch)
treee36485d27304f061db9d48659aa12810a8bcf8fc /src/headers.lua
parenta63fa963b7bd01f1b470bea7c5a2ed326ff760e6 (diff)
downloadluasocket-3dd5fb0468977c6626fe4a0ea7b95222f14da09f.tar.gz
luasocket-3dd5fb0468977c6626fe4a0ea7b95222f14da09f.tar.bz2
luasocket-3dd5fb0468977c6626fe4a0ea7b95222f14da09f.zip
Apply code review suggestions
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Diffstat (limited to 'src/headers.lua')
-rw-r--r--src/headers.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/headers.lua b/src/headers.lua
index f8b8ef8..004ef37 100644
--- a/src/headers.lua
+++ b/src/headers.lua
@@ -36,6 +36,9 @@ setmetatable(_M.canonic, {
36-- adds a header with a given canonical capitalization, e.g. for headers 36-- adds a header with a given canonical capitalization, e.g. for headers
37-- whose capitalization titlecase(header) would not reproduce correctly 37-- whose capitalization titlecase(header) would not reproduce correctly
38function _M.setcanonic(header) 38function _M.setcanonic(header)
39 if type(header) ~= "string" then
40 error("header must be a string", 2)
41 end
39 _M.canonic[header:lower()] = header 42 _M.canonic[header:lower()] = header
40end 43end
41 44