فهرست منبع

fix server rules empty

Tokumeikoi 5 سال پیش
والد
کامیت
bfeab8eae2
2فایلهای تغییر یافته به همراه4 افزوده شده و 4 حذف شده
  1. 2 2
      app/Http/Controllers/Server/DeepbworkController.php
  2. 2 2
      app/Http/Controllers/Server/PoseidonController.php

+ 2 - 2
app/Http/Controllers/Server/DeepbworkController.php

@@ -146,7 +146,7 @@ class DeepbworkController extends Controller
         if ($server->rules) {
             $rules = json_decode($server->rules);
             // domain
-            if (isset($rules->domain)) {
+            if (isset($rules->domain) && !empty($rules->domain)) {
                 $domainObj = new \StdClass();
                 $domainObj->type = 'field';
                 $domainObj->domain = $rules->domain;
@@ -154,7 +154,7 @@ class DeepbworkController extends Controller
                 array_push($json->routing->rules, $domainObj);
             }
             // protocol
-            if (isset($rules->protocol)) {
+            if (isset($rules->protocol) && !empty($rules->protocol)) {
                 $protocolObj = new \StdClass();
                 $protocolObj->type = 'field';
                 $protocolObj->protocol = $rules->protocol;

+ 2 - 2
app/Http/Controllers/Server/PoseidonController.php

@@ -137,7 +137,7 @@ class PoseidonController extends Controller
         if ($server->rules) {
             $rules = json_decode($server->rules);
             // domain
-            if (isset($rules->domain)) {
+            if (isset($rules->domain) && !empty($rules->domain)) {
                 $domainObj = new \StdClass();
                 $domainObj->type = 'field';
                 $domainObj->domain = $rules->domain;
@@ -145,7 +145,7 @@ class PoseidonController extends Controller
                 array_push($json->routing->rules, $domainObj);
             }
             // protocol
-            if (isset($rules->protocol)) {
+            if (isset($rules->protocol) && !empty($rules->protocol)) {
                 $protocolObj = new \StdClass();
                 $protocolObj->type = 'field';
                 $protocolObj->protocol = $rules->protocol;