coolify/app/Http/Middleware
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
..
ApiAbility.php feat: introduce root permission 2024-12-09 10:52:38 +01:00
ApiAllowed.php refactor(dns-validation): rename DNS validation functions for consistency and clarity, and remove unused code 2025-09-09 09:00:35 +02:00
ApiSensitiveData.php fix: root + read:sensive could read senstive data with a middlewarew 2024-12-09 11:10:35 +01:00
Authenticate.php
CanAccessTerminal.php refactor(auth): simplify access control logic in CanAccessTerminal and ServerPolicy by allowing all users to perform actions 2025-08-28 10:48:24 +02:00
CanCreateResources.php feat(acl): Change views/backend code to able to use proper ACL's later on. Currently it is not enabled. 2025-08-26 10:27:38 +02:00
CanUpdateResource.php feat(acl): Change views/backend code to able to use proper ACL's later on. Currently it is not enabled. 2025-08-26 10:27:38 +02:00
CheckForcePasswordReset.php
DecideWhatToDoWithUser.php
EncryptCookies.php
PreventRequestsDuringMaintenance.php
RedirectIfAuthenticated.php
TrimStrings.php
TrustHosts.php fix: ensure negative cache results are stored in TrustHosts middleware 2025-10-15 22:15:55 +02:00
TrustProxies.php
ValidateSignature.php
VerifyCsrfToken.php fix(webhooks): exclude webhook routes from CSRF protection (#6200) 2025-07-18 19:04:08 +02:00