Skip to content

Commit

Permalink
Merge pull request #2281 from Mashape/perf/lambda-timestamp
Browse files Browse the repository at this point in the history
perf(aws-lambda) use ngx.time in place of os.time
  • Loading branch information
p0pr0ck5 authored Mar 29, 2017
2 parents 1a7ba56 + cbc3768 commit 82a6951
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kong/plugins/aws-lambda/v4.lua
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ local function prepare_awsv4_request(tbl)
return nil, "either 'signing_key' or 'secret_key' must be provided"
end
end
local timestamp = tbl.timestamp or os.time()
local tls = tbl.tls
if tls == nil then tls = true end
local port = tbl.port or (tls and 443 or 80)
local timestamp = tbl.timestamp or ngx.time()
local req_date = os.date("!%Y%m%dT%H%M%SZ", timestamp)
local date = os.date("!%Y%m%d", timestamp)

Expand Down Expand Up @@ -225,4 +225,4 @@ local function prepare_awsv4_request(tbl)
}
end

return prepare_awsv4_request
return prepare_awsv4_request

0 comments on commit 82a6951

Please sign in to comment.