mirror of
https://github.com/tiennm99/coolify.git
synced 2026-07-13 07:05:38 +00:00
fix(validation): add URL validation for proxy redirect input (#9241)
This commit is contained in:
@@ -6,6 +6,7 @@ use App\Actions\Proxy\GetProxyConfiguration;
|
||||
use App\Actions\Proxy\SaveProxyConfiguration;
|
||||
use App\Enums\ProxyTypes;
|
||||
use App\Models\Server;
|
||||
use App\Rules\SafeExternalUrl;
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
use Livewire\Component;
|
||||
|
||||
@@ -41,9 +42,13 @@ class Proxy extends Component
|
||||
];
|
||||
}
|
||||
|
||||
protected $rules = [
|
||||
'generateExactLabels' => 'required|boolean',
|
||||
];
|
||||
protected function rules()
|
||||
{
|
||||
return [
|
||||
'generateExactLabels' => 'required|boolean',
|
||||
'redirectUrl' => ['nullable', new SafeExternalUrl],
|
||||
];
|
||||
}
|
||||
|
||||
public function mount()
|
||||
{
|
||||
@@ -147,6 +152,7 @@ class Proxy extends Component
|
||||
{
|
||||
try {
|
||||
$this->authorize('update', $this->server);
|
||||
$this->validate();
|
||||
SaveProxyConfiguration::run($this->server, $this->proxySettings);
|
||||
$this->server->proxy->redirect_url = $this->redirectUrl;
|
||||
$this->server->save();
|
||||
|
||||
Reference in New Issue
Block a user