API: nicht-numerische Routen-IDs als 404 statt TypeError/500
Ein vergessener Postman-Platzhalter (PM_ID) lief als String in die int-typisierten Controller-Parameter. Numerische where-Constraints auf den v1- und /service-Gruppen; Legacy faellt in den 410-Catch-all. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
7a573ca02b
commit
9cb53b1e17
3 changed files with 20 additions and 0 deletions
|
|
@ -214,3 +214,17 @@ test('api submit records the declared ai grade as binding confirmation', functio
|
|||
// Audit-Trail: der Submit protokolliert die Deklaration versioniert.
|
||||
->and($fresh->aiDeclarations()->count())->toBe(1);
|
||||
});
|
||||
|
||||
test('api routes respond 404 instead of 500 for non-numeric press release ids', function () {
|
||||
/** @var TestCase $this */
|
||||
$user = User::factory()->create();
|
||||
|
||||
Sanctum::actingAs($user, ['press-releases:write']);
|
||||
|
||||
// Vergessener Postman-Platzhalter wie „PM_ID" darf nicht als String in
|
||||
// die int-typisierten Controller-Parameter laufen (TypeError/500).
|
||||
$this->postJson('/api/v1/press-releases/PM_ID/submit', ['ai_text_declaration' => 'none'])
|
||||
->assertNotFound();
|
||||
$this->getJson('/api/v1/press-releases/PM_ID')
|
||||
->assertNotFound();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue