An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix(forms): prevent reparsing partial numeric hosts
Andras Bacsai0824c91acad8
diff --git a/resources/views/components/forms/domain-input.blade.php b/resources/views/components/forms/domain-input.blade.phpindex e7fc1c0630..d6e6bce856 100644--- a/resources/views/components/forms/domain-input.blade.php+++ b/resources/views/components/forms/domain-input.blade.php@@ -39,7 +39,11 @@const path = this.path.trim();const normalizedPath = path && !['/', '?', '#'].includes(path[0]) ? `/${path}` : path;const next = `${this.scheme}://${this.host.trim()}${this.port ? `:${this.port}` : ''}${normalizedPath}`;- if (this.value !== next) this.value = next;+ if (this.value !== next) {+ this.syncing = true;+ this.value = next;+ this.$nextTick(() => this.syncing = false);+ }},}" x-modelable="value" {{ $attributes->whereStartsWith('x-model') }}><div class="min-w-0">diff --git a/tests/Feature/SplitUrlInputTest.php b/tests/Feature/SplitUrlInputTest.phpindex 5bfa0feb60..e05cc9eb2b 100644--- a/tests/Feature/SplitUrlInputTest.php+++ b/tests/Feature/SplitUrlInputTest.php@@ -22,6 +22,18 @@ it('renders configurable host copy for S3 endpoints', function () {->toContain("path: ''");});+it('does not reparse partial numeric hosts while typing', function () {+ $view = file_get_contents(resource_path('views/components/forms/domain-input.blade.php'));+ $writeMethod = str($view)->between('write() {', "\n },\n}")->value();++ expect($writeMethod)+ ->toContain('this.syncing = true;')+ ->toContain('this.value = next;')+ ->toContain('this.$nextTick(() => this.syncing = false);')+ ->and(strpos($writeMethod, 'this.syncing = true;'))+ ->toBeLessThan(strpos($writeMethod, 'this.value = next;'));+});+it('keeps validation errors attached to the composed endpoint', function () {$settingsUrl = route('settings.advanced').'#endpoint-section';$errors = new ViewErrorBag;