File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 6868local _M = {
6969 _VERSION = ' 0.05' ,
7070}
71+ _M ._USER_AGENT = " lua-resty-http/" .. _M ._VERSION .. " (Lua) ngx_lua/" .. ngx .config .ngx_lua_version
7172
7273local mt = { __index = _M }
7374
@@ -77,8 +78,6 @@ local HTTP = {
7778 [1.1 ] = " HTTP/1.1\r\n " ,
7879}
7980
80- local USER_AGENT = " Resty/HTTP " .. _M ._VERSION .. " (Lua)"
81-
8281local DEFAULT_PARAMS = {
8382 method = " GET" ,
8483 path = " /" ,
@@ -517,7 +516,7 @@ function _M.send_request(self, params)
517516 headers [" Host" ] = self .host
518517 end
519518 if not headers [" User-Agent" ] then
520- headers [" User-Agent" ] = USER_AGENT
519+ headers [" User-Agent" ] = _M . _USER_AGENT
521520 end
522521 if params .version == 1.0 and not headers [" Connection" ] then
523522 headers [" Connection" ] = " Keep-Alive"
You can’t perform that action at this time.
0 commit comments