├── .editorconfig ├── .eslintrc.json ├── .github ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE │ ├── bug-report.md │ ├── config.yml │ └── feature-request.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ └── build-and-test.yml ├── .gitignore ├── .node-version ├── .prettierrc.yml ├── .vscode └── settings.json ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── example-hoc-9 ├── .gitignore ├── next-env.d.ts ├── next.config.js ├── package-lock.json ├── package.json ├── pages │ ├── _app.tsx │ ├── _document.tsx │ ├── index.tsx │ ├── redirector.tsx │ └── second.tsx ├── public │ └── .gitkeep └── tsconfig.json ├── example-static-10-i18n ├── .gitignore ├── next-env.d.ts ├── next.config.js ├── package-lock.json ├── package.json ├── pages │ ├── _document.tsx │ ├── index.tsx │ └── second.tsx ├── public │ └── .gitkeep └── tsconfig.json ├── example-static-10 ├── .gitignore ├── next-env.d.ts ├── next.config.js ├── package-lock.json ├── package.json ├── pages │ ├── _document.tsx │ ├── index.tsx │ └── second.tsx ├── public │ └── .gitkeep └── tsconfig.json ├── example-static-9 ├── .gitignore ├── next-env.d.ts ├── next.config.js ├── package-lock.json ├── package.json ├── pages │ ├── _document.tsx │ ├── index.tsx │ └── second.tsx ├── public │ └── .gitkeep └── tsconfig.json ├── jest.config.js ├── package.json ├── src ├── index.spec.ts ├── index.ts ├── rules │ ├── content-security-policy.spec.ts │ ├── content-security-policy.ts │ ├── expect-ct.spec.ts │ ├── expect-ct.ts │ ├── force-https-redirect.spec.ts │ ├── force-https-redirect.ts │ ├── frame-guard.spec.ts │ ├── frame-guard.ts │ ├── index.ts │ ├── noopen.spec.ts │ ├── noopen.ts │ ├── nosniff.spec.ts │ ├── nosniff.ts │ ├── referrer-policy.spec.ts │ ├── referrer-policy.ts │ ├── shared │ │ ├── array-wrapper.spec.ts │ │ ├── array-wrapper.ts │ │ ├── index.ts │ │ ├── uri-encoder.spec.ts │ │ └── uri-encoder.ts │ ├── xss-protection.spec.ts │ └── xss-protection.ts └── shared │ ├── custom-types.ts │ └── index.ts └── tsconfig.json /.editorconfig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/.editorconfig -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/.eslintrc.json -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/.github/CONTRIBUTING.md -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/.github/ISSUE_TEMPLATE/bug-report.md -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/.github/ISSUE_TEMPLATE/feature-request.md -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/.github/PULL_REQUEST_TEMPLATE.md -------------------------------------------------------------------------------- /.github/workflows/build-and-test.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/.github/workflows/build-and-test.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/.gitignore -------------------------------------------------------------------------------- /.node-version: -------------------------------------------------------------------------------- 1 | 12.20.0 2 | -------------------------------------------------------------------------------- /.prettierrc.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/.prettierrc.yml -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/.vscode/settings.json -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/CHANGELOG.md -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/CODE_OF_CONDUCT.md -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/README.md -------------------------------------------------------------------------------- /example-hoc-9/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-hoc-9/.gitignore -------------------------------------------------------------------------------- /example-hoc-9/next-env.d.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-hoc-9/next-env.d.ts -------------------------------------------------------------------------------- /example-hoc-9/next.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | poweredByHeader: false, 3 | }; 4 | -------------------------------------------------------------------------------- /example-hoc-9/package-lock.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-hoc-9/package-lock.json -------------------------------------------------------------------------------- /example-hoc-9/package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-hoc-9/package.json -------------------------------------------------------------------------------- /example-hoc-9/pages/_app.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-hoc-9/pages/_app.tsx -------------------------------------------------------------------------------- /example-hoc-9/pages/_document.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-hoc-9/pages/_document.tsx -------------------------------------------------------------------------------- /example-hoc-9/pages/index.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-hoc-9/pages/index.tsx -------------------------------------------------------------------------------- /example-hoc-9/pages/redirector.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-hoc-9/pages/redirector.tsx -------------------------------------------------------------------------------- /example-hoc-9/pages/second.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-hoc-9/pages/second.tsx -------------------------------------------------------------------------------- /example-hoc-9/public/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /example-hoc-9/tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-hoc-9/tsconfig.json -------------------------------------------------------------------------------- /example-static-10-i18n/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-static-10-i18n/.gitignore -------------------------------------------------------------------------------- /example-static-10-i18n/next-env.d.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-static-10-i18n/next-env.d.ts -------------------------------------------------------------------------------- /example-static-10-i18n/next.config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-static-10-i18n/next.config.js -------------------------------------------------------------------------------- /example-static-10-i18n/package-lock.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-static-10-i18n/package-lock.json -------------------------------------------------------------------------------- /example-static-10-i18n/package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-static-10-i18n/package.json -------------------------------------------------------------------------------- /example-static-10-i18n/pages/_document.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-static-10-i18n/pages/_document.tsx -------------------------------------------------------------------------------- /example-static-10-i18n/pages/index.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-static-10-i18n/pages/index.tsx -------------------------------------------------------------------------------- /example-static-10-i18n/pages/second.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-static-10-i18n/pages/second.tsx -------------------------------------------------------------------------------- /example-static-10-i18n/public/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /example-static-10-i18n/tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-static-10-i18n/tsconfig.json -------------------------------------------------------------------------------- /example-static-10/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-static-10/.gitignore -------------------------------------------------------------------------------- /example-static-10/next-env.d.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-static-10/next-env.d.ts -------------------------------------------------------------------------------- /example-static-10/next.config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-static-10/next.config.js -------------------------------------------------------------------------------- /example-static-10/package-lock.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-static-10/package-lock.json -------------------------------------------------------------------------------- /example-static-10/package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-static-10/package.json -------------------------------------------------------------------------------- /example-static-10/pages/_document.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-static-10/pages/_document.tsx -------------------------------------------------------------------------------- /example-static-10/pages/index.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-static-10/pages/index.tsx -------------------------------------------------------------------------------- /example-static-10/pages/second.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-static-10/pages/second.tsx -------------------------------------------------------------------------------- /example-static-10/public/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /example-static-10/tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-static-10/tsconfig.json -------------------------------------------------------------------------------- /example-static-9/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-static-9/.gitignore -------------------------------------------------------------------------------- /example-static-9/next-env.d.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-static-9/next-env.d.ts -------------------------------------------------------------------------------- /example-static-9/next.config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-static-9/next.config.js -------------------------------------------------------------------------------- /example-static-9/package-lock.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-static-9/package-lock.json -------------------------------------------------------------------------------- /example-static-9/package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-static-9/package.json -------------------------------------------------------------------------------- /example-static-9/pages/_document.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-static-9/pages/_document.tsx -------------------------------------------------------------------------------- /example-static-9/pages/index.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-static-9/pages/index.tsx -------------------------------------------------------------------------------- /example-static-9/pages/second.tsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-static-9/pages/second.tsx -------------------------------------------------------------------------------- /example-static-9/public/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /example-static-9/tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/example-static-9/tsconfig.json -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/jest.config.js -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/package.json -------------------------------------------------------------------------------- /src/index.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/src/index.spec.ts -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/src/index.ts -------------------------------------------------------------------------------- /src/rules/content-security-policy.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/src/rules/content-security-policy.spec.ts -------------------------------------------------------------------------------- /src/rules/content-security-policy.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/src/rules/content-security-policy.ts -------------------------------------------------------------------------------- /src/rules/expect-ct.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/src/rules/expect-ct.spec.ts -------------------------------------------------------------------------------- /src/rules/expect-ct.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/src/rules/expect-ct.ts -------------------------------------------------------------------------------- /src/rules/force-https-redirect.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/src/rules/force-https-redirect.spec.ts -------------------------------------------------------------------------------- /src/rules/force-https-redirect.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/src/rules/force-https-redirect.ts -------------------------------------------------------------------------------- /src/rules/frame-guard.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/src/rules/frame-guard.spec.ts -------------------------------------------------------------------------------- /src/rules/frame-guard.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/src/rules/frame-guard.ts -------------------------------------------------------------------------------- /src/rules/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/src/rules/index.ts -------------------------------------------------------------------------------- /src/rules/noopen.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/src/rules/noopen.spec.ts -------------------------------------------------------------------------------- /src/rules/noopen.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/src/rules/noopen.ts -------------------------------------------------------------------------------- /src/rules/nosniff.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/src/rules/nosniff.spec.ts -------------------------------------------------------------------------------- /src/rules/nosniff.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/src/rules/nosniff.ts -------------------------------------------------------------------------------- /src/rules/referrer-policy.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/src/rules/referrer-policy.spec.ts -------------------------------------------------------------------------------- /src/rules/referrer-policy.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/src/rules/referrer-policy.ts -------------------------------------------------------------------------------- /src/rules/shared/array-wrapper.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/src/rules/shared/array-wrapper.spec.ts -------------------------------------------------------------------------------- /src/rules/shared/array-wrapper.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/src/rules/shared/array-wrapper.ts -------------------------------------------------------------------------------- /src/rules/shared/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/src/rules/shared/index.ts -------------------------------------------------------------------------------- /src/rules/shared/uri-encoder.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/src/rules/shared/uri-encoder.spec.ts -------------------------------------------------------------------------------- /src/rules/shared/uri-encoder.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/src/rules/shared/uri-encoder.ts -------------------------------------------------------------------------------- /src/rules/xss-protection.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/src/rules/xss-protection.spec.ts -------------------------------------------------------------------------------- /src/rules/xss-protection.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/src/rules/xss-protection.ts -------------------------------------------------------------------------------- /src/shared/custom-types.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/src/shared/custom-types.ts -------------------------------------------------------------------------------- /src/shared/index.ts: -------------------------------------------------------------------------------- 1 | export type { ResponseHeader } from "./custom-types"; 2 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jagaapple/next-secure-headers/HEAD/tsconfig.json --------------------------------------------------------------------------------