fix(applications): store custom nginx config from API correctly

Decode base64 custom_nginx_configuration before model assignment so it is not double-encoded, and allow null values when clearing the setting. Add API coverage for create, update, invalid input, and clearing behavior.
This commit is contained in:
Andras Bacsai
2026-05-11 22:22:01 +02:00
parent 27b44fce4d
commit a42613168d
5 changed files with 187 additions and 35 deletions
+2 -2
View File
@@ -886,8 +886,8 @@ class Application extends BaseModel
public function customNginxConfiguration(): Attribute
{
return Attribute::make(
set: fn ($value) => base64_encode($value),
get: fn ($value) => base64_decode($value),
set: fn ($value) => is_null($value) ? null : base64_encode($value),
get: fn ($value) => is_null($value) ? null : base64_decode($value),
);
}