Prechádzať zdrojové kódy

remove headers as its not passed to exported app

Abhinav 3 rokov pred
rodič
commit
e02347486f
3 zmenil súbory, kde vykonal 0 pridanie a 48 odobranie
  1. 0 42
      next.config.js
  2. 0 1
      package.json
  3. 0 5
      yarn.lock

+ 0 - 42
next.config.js

@@ -11,19 +11,6 @@ const gitSha = cp.execSync('git rev-parse --short HEAD', {
     encoding: 'utf8',
 });
 
-const { createSecureHeaders } = require('next-secure-headers');
-
-const COOP_COEP_HEADERS = [
-    {
-        key: 'Cross-Origin-Opener-Policy',
-        value: 'same-origin',
-    },
-    {
-        key: 'Cross-Origin-Embedder-Policy',
-        value: 'require-corp',
-    },
-];
-
 module.exports = withSentryConfig(
     withWorkbox(
         withBundleAnalyzer({
@@ -34,35 +21,6 @@ module.exports = withSentryConfig(
                 swSrc: 'src/serviceWorker.js',
                 exclude: [/manifest\.json$/i],
             },
-
-            // added to enabled shared Array buffer - https://web.dev/coop-coep/
-            headers() {
-                return [
-                    {
-                        // Apply these headers to all routes in your application....
-                        source: '/(.*)',
-                        headers: [
-                            ...COOP_COEP_HEADERS,
-                            ...createSecureHeaders({
-                                contentSecurityPolicy: {
-                                    reportOnly: true,
-                                    directives: {
-                                        defaultSrc: `'self'`,
-                                        frameAncestors: `'self'`,
-                                        objectSrc: `'none'`,
-                                        baseURI: `'self'`,
-                                        formAction: `'self'`,
-                                        reportURI:
-                                            'https://csp-reporter.ente.workers.dev',
-                                        reportTo:
-                                            'https://csp-reporter.ente.workers.dev',
-                                    },
-                                },
-                            }),
-                        ],
-                    },
-                ];
-            },
             // https://dev.to/marcinwosinek/how-to-add-resolve-fallback-to-webpack-5-in-nextjs-10-i6j
             webpack: (config, { isServer }) => {
                 if (!isServer) {

+ 0 - 1
package.json

@@ -85,7 +85,6 @@
     "eslint-plugin-react": "^7.23.2",
     "husky": "^7.0.1",
     "lint-staged": "^11.1.2",
-    "next-secure-headers": "^2.2.0",
     "prettier": "2.3.2",
     "typescript": "^4.1.3"
   },

+ 0 - 5
yarn.lock

@@ -4613,11 +4613,6 @@ negotiator@0.6.2:
   resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz"
   integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==
 
-next-secure-headers@^2.2.0:
-  version "2.2.0"
-  resolved "https://registry.yarnpkg.com/next-secure-headers/-/next-secure-headers-2.2.0.tgz#d4eb1b00a424f811c1455d1288990a4aad3026af"
-  integrity sha512-C7OfZ9JdSJyYMz2ZBMI/WwNbt0qNjlFWX9afUp8nEUzbz6ez3JbeopdyxSZJZJAzVLIAfyk6n73rFpd4e22jRg==
-
 next@^11.1.2:
   version "11.1.2"
   resolved "https://registry.npmjs.org/next/-/next-11.1.2.tgz"