소스 검색

Fix: Syntax error - missing return in http_post

Gogs 2 달 전
부모
커밋
d74ca74563
1개의 변경된 파일1개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 2
      package/src/client2server-minimal.lua

+ 1 - 2
package/src/client2server-minimal.lua

@@ -18,6 +18,7 @@ local function http_post(event_type, data)
     local f = io.popen("curl -s -X POST '" .. cfg.server_url .. "/api/events' -H 'Content-Type: application/json' -d '" .. json .. "'", "r")
     local result = f:read("*a")
     f:close()
+    return result
 end
 
 -- Validate MAC address (proper format with valid hex)
@@ -36,8 +37,6 @@ local function is_valid_mac(mac)
     if second == 255 then return false end
     return true
 end
-    return result
-end
 
 local function send_event(event_type, data)
     log_info("Event: " .. event_type)