coolify/app/Http
Andras Bacsai 5ce0670ca4 fix: ensure negative cache results are stored in TrustHosts middleware
Problem:
- Cache::remember() does not cache null return values
- When no FQDN was configured, the closure returned null
- This caused DB queries on every request, defeating the cache

Solution:
- Use empty string ('') as sentinel value instead of null
- Convert sentinel back to null after retrieving from cache
- Now both positive and negative results are cached properly

Changes:
- Return empty string from closure instead of null
- Add explicit sentinel-to-null conversion after cache retrieval
- Add test to verify negative caching works correctly

This ensures zero DB queries even when FQDN is not configured.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-15 22:15:55 +02:00
..
Controllers fix: improve Docker image digest handling and add auto-parse feature 2025-10-15 10:19:01 +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