Middleware to block referrer spammers using piwik/referrer-spam-blacklist. It returns a 403 response if the url host in the Referer
header is in the blacklist.
- PHP >= 7.0
- A PSR-7 http message implementation (Diactoros, Guzzle, Slim, etc...)
- A PSR-15 middleware dispatcher
This package is installable and autoloadable via Composer as middlewares/referrer-spam.
composer require middlewares/referrer-spam
$dispatcher = new Dispatcher([
new Middlewares\ReferrerSpam()
]);
$response = $dispatcher->dispatch(new ServerRequest());
Allow to configure a custom spam list if you don't want to use the piwik's one.
Please see CHANGELOG for more information about recent changes and CONTRIBUTING for contributing details.
The MIT License (MIT). Please see LICENSE for more information.