Skip to content

Commit

Permalink
Add check for client disconnected after curl
Browse files Browse the repository at this point in the history
  • Loading branch information
nagadomi committed Jul 25, 2017
1 parent 7dad4bc commit 458bea7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions web.lua
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,12 @@ function APIHandler:post()
local style = self:get_argument("style", "art")
local download = (self:get_argument("download", "")):len()

if client_disconnected(self) then
self:set_status(400)
self:write("client disconnected")
return
end

if tta_level == 0 then
tta_level = auto_tta_level(x, scale)
end
Expand Down

0 comments on commit 458bea7

Please sign in to comment.