2026-08-13 08:46:06 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
use App\Http\Controllers\Api\OtherController;
|
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
|
|
2026-08-13 12:23:29 +00:00
|
|
|
it('does not expose the running version on the healthcheck response', function () {
|
2026-08-13 08:46:06 +00:00
|
|
|
config(['constants.coolify.version' => '4.3.1']);
|
|
|
|
|
|
|
|
|
|
$response = (new OtherController)->healthcheck(Request::create('/api/health', 'GET'));
|
|
|
|
|
|
|
|
|
|
expect($response->getContent())->toBe('OK')
|
2026-08-13 12:23:29 +00:00
|
|
|
->and($response->headers->has('X-Coolify-Version'))->toBeFalse();
|
2026-08-13 08:46:06 +00:00
|
|
|
});
|
|
|
|
|
|
2026-08-13 12:23:29 +00:00
|
|
|
it('does not expose the running Coolify version on the public health endpoint', function () {
|
2026-08-13 08:46:06 +00:00
|
|
|
config(['constants.coolify.version' => '4.3.1']);
|
|
|
|
|
|
|
|
|
|
$this->get('/api/health')
|
|
|
|
|
->assertSuccessful()
|
|
|
|
|
->assertSee('OK')
|
2026-08-13 12:23:29 +00:00
|
|
|
->assertHeaderMissing('X-Coolify-Version');
|
2026-08-13 08:46:06 +00:00
|
|
|
});
|