mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-17 17:21:04 +00:00
Fix domain input whitespace trimming in instance settings
- Add trim() to FQDN in instantSave() method to prevent whitespace from being saved - Add trim() to FQDN in submit() method before validation and DNS checks - Prevents invalid HostSNI rules caused by leading/trailing whitespace - Fixes issue where accidental whitespace from copy-paste causes deployment failures Fixes #7797 Co-authored-by: Andras Bacsai <andrasbacsai@users.noreply.github.com>
This commit is contained in:
@@ -80,7 +80,7 @@ class Index extends Component
|
||||
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;
|
||||
@@ -121,6 +121,11 @@ class Index extends Component
|
||||
}
|
||||
$this->validate();
|
||||
|
||||
// Trim FQDN to remove leading/trailing whitespace
|
||||
if ($this->fqdn) {
|
||||
$this->fqdn = trim($this->fqdn);
|
||||
}
|
||||
|
||||
if ($this->settings->is_dns_validation_enabled && $this->fqdn) {
|
||||
if (! validateDNSEntry($this->fqdn, $this->server)) {
|
||||
$this->dispatch('error', "Validating DNS failed.<br><br>Make sure you have added the DNS records correctly.<br><br>{$this->fqdn}->{$this->server->ip}<br><br>Check this <a target='_blank' class='underline dark:text-white' href='https://coolify.io/docs/knowledge-base/dns-configuration'>documentation</a> for further help.");
|
||||
|
||||
Reference in New Issue
Block a user