'[a-z][a-z0-9]{1,30}', 'path' => 'assets/.+'], methods: ['GET'])] public function asset(string $plugin, string $path): Response { $file = $this->plugins->assetFile($plugin, $path) ?? throw $this->createNotFoundException('Datei nicht gefunden.'); $response = new BinaryFileResponse($file, 200, [], false); $response->headers->set('Content-Type', PluginRegistry::ASSET_TYPES[strtolower(pathinfo($file, PATHINFO_EXTENSION))]); $response->headers->set('Cache-Control', 'public, max-age=31536000, immutable'); $response->headers->set('X-Content-Type-Options', 'nosniff'); return $response; } }