Akzeptiere die Shinkan-Adresse mit und ohne /api-Pfad
Deploy Test / test (push) Successful in 2m28s
Deploy Test / deploy (push) Successful in 25s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Sonnet 5.5 committed 2026-11-23 18:19:32 +01:00
1 parent b901b02cce
commit e5b3eea7de
2 files changed
+23 -1

No files matched your search

+10 -1
View File
@@ -27,7 +27,16 @@ public function url(): ?string
{
$value = config('services.shinkan.url');
return is_string($value) && trim($value) !== '' ? rtrim(trim($value), '/') : null;
if (! is_string($value) || trim($value) === '') {
return null;
}
// Die Adresse ist die der Shinkan-Installation. Der Pfad `/api/distribution/v1` hängt der Abruf selbst an; wer ihn
// (oder nur `/api`) mit einträgt, bekommt trotzdem die richtige Adresse und keinen doppelten Pfad.
$base = rtrim(trim($value), '/');
$base = (string) preg_replace('#/api(/distribution(/v1)?)?$#', '', $base);
return $base === '' ? null : $base;
}
public function apiKey(): ?string