coolify/app/Http
Andras Bacsai fa8393184f refactor: improve validation error handling and coding standards
Changes:
1. Add explicit try-catch blocks around validateDockerComposeForInjection()
   in API endpoints to return proper 422 JSON responses with validation errors
2. Rename $service_payload to $servicePayload for PSR-12 compliance (camelCase)

API endpoints now properly handle validation failures:
- One-click service creation (line 334)
- Custom compose service creation (line 480)
- Service update endpoint (line 808)

All return consistent error format:
{
  "message": "Validation failed.",
  "errors": {
    "docker_compose_raw": "Invalid Docker Compose service name: ..."
  }
}

Livewire components already have proper exception handling via handleError().

All 60 security tests pass (176 assertions).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-16 09:51:37 +02:00
..
Controllers refactor: improve validation error handling and coding standards 2025-10-16 09:51:37 +02:00
Middleware fix: ensure negative cache results are stored in TrustHosts middleware 2025-10-15 22:15:55 +02:00
Kernel.php feat: implement TrustHosts middleware to handle FQDN and IP address trust logic 2025-10-15 15:28:21 +02:00