瀏覽代碼

fix dns port string to int

Tokumeikoi 5 年之前
父節點
當前提交
54a8542e0f
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      app/Services/ServerService.php

+ 6 - 0
app/Services/ServerService.php

@@ -59,6 +59,12 @@ class ServerService
                 array_push($dns->servers, '1.1.1.1');
                 array_push($dns->servers, 'localhost');
             }
+            $dns->servers = array_map(function ($v) {
+               if (is_object($v)) {
+                   $v->port = (int)$v->port;
+               }
+               return $v;
+            }, $dns->servers);
             $json->dns = $dns;
             $json->outbound->settings->domainStrategy = 'UseIP';
         }