Skip to content

Commit

Permalink
fix(*): variable scope
Browse files Browse the repository at this point in the history
  • Loading branch information
tysoekong committed Jun 6, 2024
1 parent a13a887 commit cbd40a4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/resty/aws/request/execute.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,17 @@ local function execute_request(signed_request)
if response.headers["application/vnd.amazon.eventstream"] then
body_reader = response.body_reader
else
body do
local this_body do
if response.has_body then
body, err = response:read_body()
if not body then
this_body, err = response:read_body()
if not this_body then
return nil, ("failed reading response body from '%s:%s': %s"):format(
tostring(signed_request.host),
tostring(signed_request.port),
tostring(err))
end

body = this_body
end
end
end
Expand Down

0 comments on commit cbd40a4

Please sign in to comment.