put($path, 'branding-content'); $url = URL::temporarySignedRoute( 'api.v1.branding.asset', now()->addMinutes(5), ['path' => $path] ); $response = $this->get($url); $response->assertOk(); $this->assertSame('branding-content', $response->streamedContent()); $this->assertStringContainsString('max-age=3600', $response->headers->get('Cache-Control')); $this->assertStringContainsString('private', $response->headers->get('Cache-Control')); } public function test_branding_asset_rejects_invalid_path(): void { Config::set('filesystems.default', 'public'); Storage::fake('public'); $url = URL::temporarySignedRoute( 'api.v1.branding.asset', now()->addMinutes(5), ['path' => '../.env'] ); $response = $this->get($url); $response->assertStatus(404); } }