PHP code example of mitsuki / cors
1. Go to this page and download the library: Download mitsuki/cors library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mitsuki / cors example snippets
// Extend the listener
class CustomCorsListener extends CorsListener
{
protected function setCorsHeaders(Response $response): void
{
parent::setCorsHeaders($response);
$response->headers->set('Access-Control-Allow-Headers', 'X-API-Key,Authorization');
}
}
mitsuki/cors/
├── src/
│ └── CorsListener.php
├── tests/
│ └── Unit/
│ └── CorsListenerTest.php
├── composer.json
├── README.md
└── LICENSE
Made with ❤️ for the Mitsuki PHP framework