Middleware to block referrer spammers
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 library
- A PSR-15 middleware dispatcher
ext-intlPHP extension or true/punycode as alternative
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.
The MIT License (MIT). Please see LICENSE for more information.