middlewares/referrer-spam 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

middlewares/referrer-spam

Composer 安装命令:

composer require middlewares/referrer-spam

包简介

Middleware to block referrer spammers

README 文档

README

Latest Version on Packagist Software License Testing Total Downloads

Middleware to block referrer spammers using matomo/referrer-spam-blacklist. It returns a 403 response if the url host in the Referer header is in the blacklist.

Requirements

ext-intl PHP extension is recommended otherwise symfony/polyfill-intl-idn is used.

Installation

This package is installable and autoloadable via Composer as middlewares/referrer-spam.

composer require middlewares/referrer-spam

Usage

By default, use matomo/referrer-spam-blacklist as a list of spammers

$spam = new Middlewares\ReferrerSpam();

But you can configure a custom spam list if you don't want to use the default:

$spammers = [
    'http://www.0n-line.tv',
    'http://холодныйобзвон.рф',
];

$spam = new Middlewares\ReferrerSpam($spammers);

Optionally, you can provide a Psr\Http\Message\ResponseFactoryInterface as the second argument to create the error responses (403). If it's not defined, Middleware\Utils\Factory will be used to detect it automatically.

$responseFactory = new MyOwnResponseFactory();

$spam = new Middlewares\ReferrerSpam($spammers, $responseFactory);

Please see CHANGELOG for more information about recent changes and CONTRIBUTING for contributing details.

The MIT License (MIT). Please see LICENSE for more information.

统计信息

  • 总下载量: 59.84k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 11
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 11
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-10-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固