mirror of
https://github.com/lunarmodules/luasocket.git
synced 2025-04-21 16:06:44 +02:00
Compare commits
1 Commits
9148644220
...
d6647374c8
Author | SHA1 | Date | |
---|---|---|---|
|
d6647374c8 |
@ -7,37 +7,11 @@ local socket = require("socket")
|
|||||||
socket.headers = {}
|
socket.headers = {}
|
||||||
local _M = socket.headers
|
local _M = socket.headers
|
||||||
|
|
||||||
local parts = {
|
|
||||||
ch="CH",
|
|
||||||
dns="DNS",
|
|
||||||
ect="ECT",
|
|
||||||
etag="ETag",
|
|
||||||
gpc="GPC",
|
|
||||||
id="ID",
|
|
||||||
md5="MD5",
|
|
||||||
mime="MIME",
|
|
||||||
mta="MTA",
|
|
||||||
nel="NEL",
|
|
||||||
rtt="RTT",
|
|
||||||
smtp="SMTP",
|
|
||||||
sourcemap="SourceMap",
|
|
||||||
te="TE",
|
|
||||||
ua="UA",
|
|
||||||
websocket="WebSocket",
|
|
||||||
wow64="WoW64",
|
|
||||||
www="WWW",
|
|
||||||
xss="XSS",
|
|
||||||
}
|
|
||||||
|
|
||||||
_M.canonic = setmetatable({},{
|
_M.canonic = setmetatable({},{
|
||||||
__index=function (t,k)
|
__index=function (t,k)
|
||||||
t[k] = string.gsub(k, "%f[%w]%l", function (part)
|
t[k] = string.gsub(k, "%f[%w]%l", string.upper)
|
||||||
return parts[part] or string.upper(part)
|
|
||||||
end)
|
|
||||||
return t[k]
|
return t[k]
|
||||||
end;
|
end;
|
||||||
})
|
})
|
||||||
|
|
||||||
_M.parts = parts
|
|
||||||
|
|
||||||
return _M
|
return _M
|
||||||
|
Loading…
x
Reference in New Issue
Block a user