mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-15 20:15:45 +00:00
fix(domains): preserve ports in split URL inputs (#11328)
This commit is contained in:
1 parent
5872cc095c
commit
282227b238
17 files changed
+182
-161
No files matched your search
@@ -5,6 +5,7 @@ namespace App\Livewire\Storage;
|
||||
use App\Models\S3Storage;
|
||||
use App\Rules\SafeWebhookUrl;
|
||||
use App\Rules\ValidS3BucketName;
|
||||
use App\Support\DomainUrlParts;
|
||||
use App\Support\ValidationPatterns;
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
use Illuminate\Support\Uri;
|
||||
@@ -28,6 +29,10 @@ class Create extends Component
|
||||
|
||||
public string $endpoint = '';
|
||||
|
||||
public array $endpointParts = ['scheme' => 'https', 'host' => '', 'port' => '', 'path' => ''];
|
||||
|
||||
public bool $endpointPartsChanged = false;
|
||||
|
||||
public S3Storage $storage;
|
||||
|
||||
protected function rules(): array
|
||||
@@ -76,6 +81,9 @@ class Create extends Component
|
||||
try {
|
||||
$this->authorize('create', S3Storage::class);
|
||||
|
||||
if ($this->endpointPartsChanged) {
|
||||
$this->endpoint = DomainUrlParts::compose(...$this->endpointParts);
|
||||
}
|
||||
$this->endpoint = $this->normalizeEndpoint($this->endpoint);
|
||||
$this->validate();
|
||||
$this->storage = new S3Storage;
|
||||
@@ -101,6 +109,11 @@ class Create extends Component
|
||||
}
|
||||
}
|
||||
|
||||
public function updatedEndpointParts(): void
|
||||
{
|
||||
$this->endpointPartsChanged = true;
|
||||
}
|
||||
|
||||
private function connectionErrorDescription(\Throwable $exception): string
|
||||
{
|
||||
$settingsUrl = route('settings.advanced').'#endpoint-section';
|
||||
|
||||
Reference in new issue
Block a user