From bfeab8eae2f4da0778137bf86335f9fdc46d1887 Mon Sep 17 00:00:00 2001 From: Tokumeikoi Date: Sun, 23 Feb 2020 17:20:24 +0800 Subject: [PATCH] fix server rules empty --- app/Http/Controllers/Server/DeepbworkController.php | 4 ++-- app/Http/Controllers/Server/PoseidonController.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/Server/DeepbworkController.php b/app/Http/Controllers/Server/DeepbworkController.php index ad1b6c94..7df2fb84 100644 --- a/app/Http/Controllers/Server/DeepbworkController.php +++ b/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; diff --git a/app/Http/Controllers/Server/PoseidonController.php b/app/Http/Controllers/Server/PoseidonController.php index efb3d77d..e72a46bb 100644 --- a/app/Http/Controllers/Server/PoseidonController.php +++ b/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;