web: www-Hosts lösen aufs Apex-Domain-Theme auf statt aufs Portal-Fallback
Die Domain-Auflösung matchte den Host exakt gegen domain_name — www.presseecho.de fiel dadurch aufs Portal-Default-Theme zurück, dessen theme-portal.css im Web-Build nicht existiert. Alle Route::view-Seiten ohne Controller (Impressum, Datenschutz, AGB, FAQ, …) antworteten auf www-Hosts mit 500 (ViteException, Dauereintrag im Live-Log); die Controller-Seiten traf es nicht, weil WebPortalContext den Host tolerant matcht. resolve() normalisiert Hosts jetzt (lowercase, www. entfernt) auf beiden Seiten des Vergleichs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
6fcc825c64
commit
e69ded4fed
2 changed files with 42 additions and 2 deletions
|
|
@ -55,7 +55,13 @@ class DomainAssetContext
|
|||
return array_merge($defaults, $configuredDomains[$themeOverride]);
|
||||
}
|
||||
|
||||
$portalHost = (string) config('domains.domain_portal');
|
||||
// www-Varianten zählen als ihre Apex-Domain: Ohne Normalisierung
|
||||
// fiele z. B. www.presseecho.de auf das Portal-Default-Theme zurück,
|
||||
// dessen theme-portal.css im Web-Build nicht existiert → 500
|
||||
// (ViteException) auf allen Route::view-Seiten (Impressum, AGB, …).
|
||||
$host = self::normalizedHost($host);
|
||||
|
||||
$portalHost = self::normalizedHost((string) config('domains.domain_portal'));
|
||||
|
||||
if ($host === $portalHost) {
|
||||
$request ??= request();
|
||||
|
|
@ -72,7 +78,9 @@ class DomainAssetContext
|
|||
continue;
|
||||
}
|
||||
|
||||
if (($config['domain_name'] ?? null) === $host) {
|
||||
$domainName = $config['domain_name'] ?? null;
|
||||
|
||||
if (is_string($domainName) && self::normalizedHost($domainName) === $host) {
|
||||
return array_merge($defaults, $config);
|
||||
}
|
||||
}
|
||||
|
|
@ -80,6 +88,16 @@ class DomainAssetContext
|
|||
return $defaults;
|
||||
}
|
||||
|
||||
/**
|
||||
* Kleingeschriebener Host ohne führendes "www.".
|
||||
*/
|
||||
private static function normalizedHost(string $host): string
|
||||
{
|
||||
$host = strtolower(trim($host));
|
||||
|
||||
return str_starts_with($host, 'www.') ? substr($host, 4) : $host;
|
||||
}
|
||||
|
||||
public static function isBackendRequest(Request $request): bool
|
||||
{
|
||||
if ($request->routeIs(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue