diff options
author | Michael Martin <flrgh@protonmail.com> | 2021-12-21 17:49:17 -0800 |
---|---|---|
committer | Michael Martin <flrgh@protonmail.com> | 2021-12-21 17:49:17 -0800 |
commit | 19591ff2f4a05fcadb574c0fc588325e217bd3ff (patch) | |
tree | b8d8eaadb1e5fa5de6309e410a082cdc03690167 /meta/3rd/OpenResty/library/ngx.req.lua | |
parent | 72f6b2f920f16be027cc05bb4e189870c641817e (diff) | |
download | lua-language-server-19591ff2f4a05fcadb574c0fc588325e217bd3ff.zip |
chore: update/cleanup ngx.* modules in resty.core
Diffstat (limited to 'meta/3rd/OpenResty/library/ngx.req.lua')
-rw-r--r-- | meta/3rd/OpenResty/library/ngx.req.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/meta/3rd/OpenResty/library/ngx.req.lua b/meta/3rd/OpenResty/library/ngx.req.lua new file mode 100644 index 00000000..7f9be7e6 --- /dev/null +++ b/meta/3rd/OpenResty/library/ngx.req.lua @@ -0,0 +1,18 @@ +---@meta +local req = {} + +req.version = require("resty.core.base").version + +---This method adds the specified header and its value to the current request. It works similarly as ngx.req.set_header, with the exception that when the header already exists, the specified value(s) will be appended instead of overriden. +--- +---When the specified `header_name` is a builtin header (e.g. User-Agent), this method will override its values. +--- +---The `header_value` argument can either be a string or a non-empty, array-like table. A nil or empty table value will cause this function to throw an error. +--- +---This feature was first introduced in the v0.1.18 release. +--- +---@param header_name string must be a non-empty string. +---@param header_value string|string[] +function req.add_header(header_name, header_value) end + +return req |