Skip to content

PSR-7 Middleware that provides clickjacking protection via the X-Frame-Options header.

License

Notifications You must be signed in to change notification settings

mikicaivosevic/clickjacking-middleware

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clickjacking Protection Middleware

PSR-7 Middleware that provides clickjacking protection via the X-Frame-Options header.

Middleware that sets the X-Frame-Options HTTP header in HTTP responses. Does not set the header if it's already set. By default, sets the X-Frame-Options header to 'SAMEORIGIN', meaning the response can only be loaded on a frame within the same site.

Note: older browsers will quietly ignore this header, thus other clickjacking protection techniques should be used if protection in those browsers is required.

Installation

composer require mikica/clickjacking-middleware

Usage

In Slim 3:

//new Clickjacking\Middleware\XFrameOptions("DENY")
$app->add(new Clickjacking\Middleware\XFrameOptions());

$app->get('/', function ($request, $response, $args) {
    return $response;
});

About

PSR-7 Middleware that provides clickjacking protection via the X-Frame-Options header.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages