diff --git a/app/Livewire/Settings/Index.php b/app/Livewire/Settings/Index.php index 7a96eabb2..14c0eec32 100644 --- a/app/Livewire/Settings/Index.php +++ b/app/Livewire/Settings/Index.php @@ -80,7 +80,7 @@ public function timezones(): array public function instantSave($isSave = true) { $this->validate(); - $this->settings->fqdn = $this->fqdn; + $this->settings->fqdn = $this->fqdn ? trim($this->fqdn) : $this->fqdn; $this->settings->public_port_min = $this->public_port_min; $this->settings->public_port_max = $this->public_port_max; $this->settings->instance_name = $this->instance_name; @@ -119,6 +119,12 @@ public function submit() return; } + + // Trim FQDN to remove leading/trailing whitespace before validation + if ($this->fqdn) { + $this->fqdn = trim($this->fqdn); + } + $this->validate(); if ($this->settings->is_dns_validation_enabled && $this->fqdn) {