承接 ssx/csp-parser 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

ssx/csp-parser

最新稳定版本:0.0.1

Composer 安装命令:

composer require ssx/csp-parser

包简介

README 文档

README

This package contains a PHP class that will help you fetch and parse CSP headers from a website.

require 'vendor/autoload.php';

$csp = new \Ssx\Csp\Parser('https://www.mywebsite.com/');
var_dump($csp->getDirectives());

You can use either getDirectives() to return an array of all the processed CSP directives or you can use getDirective('script-src') to get a particular type of directive.

Each directive will contain either an array of results or an empty array for a directive such as upgrade-insecure-requests:

  "upgrade-insecure-requests" => []
  "font-src" => array:19 [
    0 => "fonts.gstatic.com"
    1 => "use.typekit.net"
    2 => "*.typekit.net"
    3 => "*.gstatic.com"
    4 => "*.hotjar.com"
    5 => "*.tidiochat.com"
    6 => "*.cookiebot.com"
    7 => "*.pcapredict.com"
    8 => "*.postcodeanywhere.co.uk"
    9 => "maxcdn.bootstrapcdn.com"
    10 => "*.stripe.com"
    11 => "klarna.com"
    12 => "*.klarna.com"
    13 => "*.klarnacdn.net"
    14 => "*.klarnaevt.com"
    15 => "*.superpayments.com"
    16 => "data:"
    17 => "'self'"
    18 => "'unsafe-inline'"
  ]

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-03-28