Преглед на файлове

Add check for client disconnected after curl

nagadomi преди 8 години
родител
ревизия
458bea7ca4
променени са 1 файла, в които са добавени 6 реда и са изтрити 0 реда
  1. 6 0
      web.lua

+ 6 - 0
web.lua

@@ -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