test production cors preflight
This commit is contained in:
parent
4702758984
commit
f9f253d04f
1 changed files with 24 additions and 0 deletions
24
backend/tests/Feature/CorsTest.php
Normal file
24
backend/tests/Feature/CorsTest.php
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\Feature;
|
||||||
|
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
class CorsTest extends TestCase
|
||||||
|
{
|
||||||
|
public function testAllowsProductionFrontendPreflight(): void
|
||||||
|
{
|
||||||
|
$response = $this->withHeaders([
|
||||||
|
'Origin' => 'https://rabbigerzi.com',
|
||||||
|
'Access-Control-Request-Method' => 'POST',
|
||||||
|
'Access-Control-Request-Headers' => 'content-type',
|
||||||
|
])->options('/login');
|
||||||
|
|
||||||
|
$response->assertNoContent();
|
||||||
|
$response->assertHeader(
|
||||||
|
'Access-Control-Allow-Origin',
|
||||||
|
'https://rabbigerzi.com'
|
||||||
|
);
|
||||||
|
$response->assertHeader('Access-Control-Allow-Credentials', 'true');
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue