mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-17 17:21:04 +00:00
fix: prevent SERVICE_FQDN/SERVICE_URL path duplication on FQDN updates
Add endsWith() checks before appending template paths in serviceParser() to prevent duplicate paths when parse() is called after FQDN updates. This fixes the bug where services like Appwrite realtime would get `/v1/realtime/v1/realtime`. Fixes #7363 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1644,9 +1644,16 @@ function serviceParser(Service $resource): Collection
|
||||
if ($value && get_class($value) === \Illuminate\Support\Stringable::class && $value->startsWith('/')) {
|
||||
$path = $value->value();
|
||||
if ($path !== '/') {
|
||||
$fqdn = "$fqdn$path";
|
||||
$url = "$url$path";
|
||||
$fqdnValueForEnv = "$fqdnValueForEnv$path";
|
||||
// Only add path if it's not already present (prevents duplication on subsequent parse() calls)
|
||||
if (! str($fqdn)->endsWith($path)) {
|
||||
$fqdn = "$fqdn$path";
|
||||
}
|
||||
if (! str($url)->endsWith($path)) {
|
||||
$url = "$url$path";
|
||||
}
|
||||
if (! str($fqdnValueForEnv)->endsWith($path)) {
|
||||
$fqdnValueForEnv = "$fqdnValueForEnv$path";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user