Переглянути джерело

fix:带端口号的host应去掉端口号进行连接

Dozingfiretruck 3 роки тому
батько
коміт
187c1b2563
1 змінених файлів з 2 додано та 1 видалено
  1. 2 1
      script/libs/libfota.lua

+ 2 - 1
script/libs/libfota.lua

@@ -122,9 +122,10 @@ local function fota_task(cbFnc,storge_location, len, param1,ota_url,ota_port,tim
         end
 
         if ota_port == nil then
-            local url_port = string.match(host,".:(%d+)")
+            local url_host,url_port = string.match(host,"(%g+):(%d+)")
             if url_port then
                 ota_port = url_port
+                host = url_host
             elseif type == "http" then
                 ota_port = 80
             elseif type == "https" then