@@ -163,7 +163,6 @@ local function request_content_type(self)
163163end
164164
165165local function post_param (self , name )
166- local content_type = self :content_type ()
167166 if self :content_type () == ' multipart/form-data' then
168167 -- TODO: do that!
169168 rawset (self , ' post_params' , {})
@@ -213,7 +212,7 @@ local function catfile(...)
213212 return
214213 end
215214
216- for i , pe in pairs (sp ) do
215+ for _ , pe in pairs (sp ) do
217216 if path == nil then
218217 path = pe
219218 elseif string.match (path , ' .$' ) ~= ' /' then
@@ -441,7 +440,7 @@ local function render(tx, opts)
441440 return resp
442441end
443442
444- local function iterate (tx , gen , param , state )
443+ local function iterate (_ , gen , param , state )
445444 return setmetatable ({ body = { gen = gen , param = param , state = state } },
446445 response_mt )
447446end
@@ -837,7 +836,7 @@ local function process_client(self, s, peer)
837836 };
838837 for k , v in pairs (hdrs ) do
839838 if type (v ) == ' table' then
840- for i , sv in pairs (v ) do
839+ for _ , sv in pairs (v ) do
841840 table.insert (response , sprintf (" %s: %s\r\n " , ucfirst (k ), sv ))
842841 end
843842 else
@@ -857,7 +856,7 @@ local function process_client(self, s, peer)
857856 if not s :write (response ) then
858857 break
859858 end
860- response = nil
859+ response = nil -- luacheck: no unused
861860 -- Transfer-Encoding: chunked
862861 for _ , part in gen , param , state do
863862 part = tostring (part )
@@ -916,7 +915,7 @@ local function match_route(self, method, route)
916915 local fit
917916 local stash = {}
918917
919- for k , r in pairs (self .routes ) do
918+ for _ , r in pairs (self .routes ) do
920919 if r .method == method or r .method == ' ANY' then
921920 local m = { string.match (route , r .match ) }
922921 local nfit
@@ -980,7 +979,7 @@ local function url_for_route(r, args, query)
980979 args = {}
981980 end
982981 local name = r .path
983- for i , sn in pairs (r .stash ) do
982+ for _ , sn in pairs (r .stash ) do
984983 local sv = args [sn ]
985984 if sv == nil then
986985 sv = ' '
@@ -1137,7 +1136,7 @@ local function add_route(self, opts, sub)
11371136
11381137 opts .match = ' ^' .. opts .match .. ' $'
11391138
1140- estash = nil
1139+ estash = nil -- luacheck: no unused
11411140
11421141 opts .stash = stash
11431142 opts .sub = sub
@@ -1196,7 +1195,7 @@ local function httpd_start(self)
11961195 local server = socket .tcp_server (self .host , self .port ,
11971196 { name = ' http' ,
11981197 handler = function (...)
1199- local res = process_client (self , ... )
1198+ process_client (self , ... )
12001199 end })
12011200 if server == nil then
12021201 error (sprintf (" Can't create tcp_server: %s" , errno .strerror ()))
0 commit comments