From 84559a0e7d71c05be9a123a96cf589d0719500c7 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Mon, 20 Oct 2025 09:48:37 +0200 Subject: [PATCH 1/3] Changes auto-committed by Conductor --- app/Http/Middleware/TrustHosts.php | 25 ++++++ .../views/components/forms/datalist.blade.php | 10 +-- tests/Feature/TrustHostsMiddlewareTest.php | 81 +++++++++++++++++++ 3 files changed, 111 insertions(+), 5 deletions(-) diff --git a/app/Http/Middleware/TrustHosts.php b/app/Http/Middleware/TrustHosts.php index c2a2cb41a..080b18acc 100644 --- a/app/Http/Middleware/TrustHosts.php +++ b/app/Http/Middleware/TrustHosts.php @@ -4,11 +4,36 @@ use App\Models\InstanceSettings; use Illuminate\Http\Middleware\TrustHosts as Middleware; +use Illuminate\Http\Request; use Illuminate\Support\Facades\Cache; use Spatie\Url\Url; class TrustHosts extends Middleware { + /** + * Handle the incoming request. + * + * Skip host validation for certain routes: + * - Terminal auth routes (called by realtime container) + * - API routes (use token-based authentication, not host validation) + * - Webhook endpoints (use cryptographic signature validation) + */ + public function handle(Request $request, $next) + { + // Skip host validation for these routes + if ($request->is( + 'terminal/auth', + 'terminal/auth/ips', + 'api/*', + 'webhooks/*' + )) { + return $next($request); + } + + // For all other routes, use parent's host validation + return parent::handle($request, $next); + } + /** * Get the host patterns that should be trusted. * diff --git a/resources/views/components/forms/datalist.blade.php b/resources/views/components/forms/datalist.blade.php index 5bb12aa8d..05f6ca946 100644 --- a/resources/views/components/forms/datalist.blade.php +++ b/resources/views/components/forms/datalist.blade.php @@ -106,7 +106,7 @@ class="flex flex-wrap gap-1.5 max-h-40 overflow-y-auto scrollbar py-1.5 w-full t wire:dirty.class="dark:border-l-warning border-l-coollabs border-l-4"> {{-- Selected Tags Inside Input --}} -