Skip to content

Commit c6e246d

Browse files
committed
chore(*) fix linting issues
1 parent 3ecbea3 commit c6e246d

File tree

5 files changed

+7
-8
lines changed

5 files changed

+7
-8
lines changed

lib/resty/session.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ local function init()
322322
end
323323

324324
local session = {
325-
_VERSION = "3.0"
325+
_VERSION = "3.1"
326326
}
327327

328328
session.__index = session
@@ -432,7 +432,7 @@ function session.new(opts)
432432

433433
local cookie = opts.cookie or defaults.cookie
434434
local name = opts.name or defaults.name
435-
local secret = opts.secret or defaults.secret
435+
local sec = opts.secret or defaults.secret
436436

437437
local secure
438438
local path
@@ -464,7 +464,7 @@ function session.new(opts)
464464
local self = {
465465
now = time(),
466466
name = name,
467-
secret = secret,
467+
secret = sec,
468468
identifier = ide,
469469
serializer = ser,
470470
strategy = str,

lib/resty/session/ciphers/none.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ function cipher.new()
44
return cipher
55
end
66

7-
function cipher:encrypt(data)
7+
function cipher.encrypt(_, data)
88
return data
99
end
1010

11-
function cipher:decrypt(data)
11+
function cipher.decrypt(_, data)
1212
return data
1313
end
1414

lib/resty/session/storage/memcache.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ function storage:destroy(id)
236236

237237
local key = self:key(id)
238238

239-
local ok, err = self:delete(key)
239+
ok, err = self:delete(key)
240240

241241
self:unlock(key)
242242
self:set_keepalive()

lib/resty/session/storage/redis.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ function storage:destroy(id)
272272

273273
local key = self:key(id)
274274

275-
local ok, err = self:delete(key)
275+
ok, err = self:delete(key)
276276

277277
self:unlock(key)
278278
self:set_keepalive()

lib/resty/session/strategies/default.lua

-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ function strategy.modify(session, action, close, key)
103103
end
104104
local hash = session.hmac(hkey, concat{ key, data, session.key })
105105

106-
local err
107106
data, err = session.cipher:encrypt(data, hkey, id, session.key)
108107
if not data then
109108
if close and storage.close then

0 commit comments

Comments
 (0)