diff --git a/src/pages/_document.tsx b/src/pages/_document.tsx index d4c3dca4d..44773354b 100644 --- a/src/pages/_document.tsx +++ b/src/pages/_document.tsx @@ -1,13 +1,6 @@ import React from 'react'; import Document, { Html, Head, Main, NextScript } from 'next/document'; import { ServerStyleSheet } from 'styled-components'; -import crypto from 'crypto'; - -const cspHashOf = (text) => { - const hash = crypto.createHash('sha256'); - hash.update(text); - return `'sha256-${hash.digest('base64')}'`; -}; export default class MyDocument extends Document { static async getInitialProps(ctx) { @@ -37,17 +30,9 @@ export default class MyDocument extends Document { } render() { - const scriptDirectiveWithHash = `script-src 'unsafe-inline' 'self' ${cspHashOf( - NextScript.getInlineScriptSource(this.props) - )};`; - return ( -