PHP code example of secureheaders / psradapter

1. Go to this page and download the library: Download secureheaders/psradapter 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/ */

    

secureheaders / psradapter example snippets


// Configure SecureHeaders
$headers = new Aidantwoods\SecureHeaders\SecureHeaders;
$headers->strictMode();

// Instantiate the adapter with your response object
$adapter = new SecureHeaders\PsrHttpAdapter\Psr7Adapter($response);

// Apply your SecureHeaders configuration
$headers->apply($adapter);

// And finally retrieve the updated HTTP response object
$response = $adapter->getSecuredResponse();