PHP Classes

File: examples/example9.php

Recommend this page to a friend!
  Classes of Tom Postma   PHP Content Security Policy generator   examples/example9.php   Download  
File: examples/example9.php
Role: Example script
Content type: text/plain
Description: require-sri-for demo.
Class: PHP Content Security Policy generator
Generate CSP headers to prevent security attacks
Author: By
Last change:
Date: 5 years ago
Size: 1,097 bytes


Class file image Download

// Set that all scripts need integrity attribute.

// Set the headers, always call this method before any content output.
// Start content output.
?><!DOCTYPE html>
        <meta charset="UTF-8">
        <title>example9 - require-sri-for</title>
        Open console(F12) and verify that jQuery javascript library is loaded.<br />

        <script type="application/javascript" src=""
        But qunit javascript library could be blocked on modern webbrowsers due to missing integrity attribute.<br />
        <small>(Firefox 49-60 requires in about:config to set security.csp.experimentalEnabled to true.)</small><br />

        <script type="application/javascript" src=""></script>