fix: reject protocol-relative deep_link
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BCrwHHnGCB5XH968Nxokqw
This commit is contained in:
@@ -89,7 +89,11 @@ class ClientApiTest extends TestCase
|
||||
$this->putJson('/api/events', ['events' => [$bad]], $this->auth())
|
||||
->assertStatus(422)->assertJsonValidationErrors(['events.0.payload.deep_link']);
|
||||
|
||||
$ok1 = $this->item(['payload' => ['title' => 'x', 'deep_link' => '/people/42']]);
|
||||
$protocolRelative = $this->item(['payload' => ['title' => 'x', 'deep_link' => '//evil.com/x']]);
|
||||
$this->putJson('/api/events', ['events' => [$protocolRelative]], $this->auth())
|
||||
->assertStatus(422)->assertJsonValidationErrors(['events.0.payload.deep_link']);
|
||||
|
||||
$ok1 = $this->item(['payload' => ['title' => 'x', 'deep_link' => '/people/42?x=1']]);
|
||||
$this->putJson('/api/events', ['events' => [$ok1]], $this->auth())->assertOk();
|
||||
|
||||
$ok2 = $this->item(['topic' => 'birthday:2027', 'payload' => ['title' => 'x', 'deep_link' => 'https://docs.example/x']]);
|
||||
|
||||
Reference in New Issue
Block a user