Advertisement
Guest User

PHP content-security-policy

a guest
May 27th, 2014
537
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.36 KB | None | 0 0
  1. <?php
  2.   header("Content-Security-Policy: script-src 'self' 'sha256-".base64_encode(hash('sha256', 'console.log("HI");', true))."'");
  3. ?><!DOCTYPE html>
  4. <html>
  5.   <head>
  6.     <title>CSP</title>
  7.     <meta charset="utf-8" />
  8.   </head>
  9.   <body>
  10.     Hello, content-security-policy!
  11.     <script type='text/javascript'>console.log("HI");</script>
  12.   </body>
  13. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement