diff options
| author | Thijs Schreijer <thijs@thijsschreijer.nl> | 2026-08-29 20:05:00 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-29 20:05:00 +0200 |
| commit | 3dd5fb0468977c6626fe4a0ea7b95222f14da09f (patch) | |
| tree | e36485d27304f061db9d48659aa12810a8bcf8fc /src/headers.lua | |
| parent | a63fa963b7bd01f1b470bea7c5a2ed326ff760e6 (diff) | |
| download | luasocket-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.lua | 3 |
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 |
| 38 | function _M.setcanonic(header) | 38 | function _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 |
| 40 | end | 43 | end |
| 41 | 44 | ||
