Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

combining root headers with route-specific headers

Blue Mouse293378825890
diff --git a/app/routes/change-email.$id.tsx b/app/routes/change-email.$id.tsx
index 7fa46c5db..be4246780 100644
--- a/app/routes/change-email.$id.tsx
+++ b/app/routes/change-email.$id.tsx
@@ -2,10 +2,9 @@ import VerifyEmail from 'pages/Auth/VerifyEmail'
import type { SitemapFunction } from 'remix-sitemap'
import type { HeadersFunction } from '@remix-run/node'
-export const headers: HeadersFunction = () => {
- return {
- 'X-Frame-Options': 'DENY',
- }
+export const headers: HeadersFunction = ({ parentHeaders }) => {
+ parentHeaders.set('X-Frame-Options', 'DENY')
+ return parentHeaders
}
export const sitemap: SitemapFunction = () => ({
diff --git a/app/routes/login.tsx b/app/routes/login.tsx
index f22cde33f..93377c0a0 100644
--- a/app/routes/login.tsx
+++ b/app/routes/login.tsx
@@ -5,10 +5,9 @@ import { json } from '@remix-run/node'
import { detectTheme } from 'utils/server'
-export const headers: HeadersFunction = () => {
- return {
- 'X-Frame-Options': 'DENY',
- }
+export const headers: HeadersFunction = ({ parentHeaders }) => {
+ parentHeaders.set('X-Frame-Options', 'DENY')
+ return parentHeaders
}
export async function loader({ request }: LoaderArgs) {
diff --git a/app/routes/password-reset.$id.tsx b/app/routes/password-reset.$id.tsx
index dd850e871..05280547e 100644
--- a/app/routes/password-reset.$id.tsx
+++ b/app/routes/password-reset.$id.tsx
@@ -2,10 +2,9 @@ import CreateNewPassword from 'pages/Auth/CreateNewPassword'
import type { SitemapFunction } from 'remix-sitemap'
import type { HeadersFunction } from '@remix-run/node'
-export const headers: HeadersFunction = () => {
- return {
- 'X-Frame-Options': 'DENY',
- }
+export const headers: HeadersFunction = ({ parentHeaders }) => {
+ parentHeaders.set('X-Frame-Options', 'DENY')
+ return parentHeaders
}
export const sitemap: SitemapFunction = () => ({
diff --git a/app/routes/recovery.tsx b/app/routes/recovery.tsx
index 99d04cc39..bd2a233d8 100644
--- a/app/routes/recovery.tsx
+++ b/app/routes/recovery.tsx
@@ -1,10 +1,9 @@
import ForgotPassword from 'pages/Auth/ForgotPassword'
import type { HeadersFunction } from '@remix-run/node'
-export const headers: HeadersFunction = () => {
- return {
- 'X-Frame-Options': 'DENY',
- }
+export const headers: HeadersFunction = ({ parentHeaders }) => {
+ parentHeaders.set('X-Frame-Options', 'DENY')
+ return parentHeaders
}
export default function Index() {
diff --git a/app/routes/signup.tsx b/app/routes/signup.tsx
index 0b5b05fa9..24bc5e9fd 100644
--- a/app/routes/signup.tsx
+++ b/app/routes/signup.tsx
@@ -6,10 +6,9 @@ import { json } from '@remix-run/node'
import { detectTheme } from 'utils/server'
-export const headers: HeadersFunction = () => {
- return {
- 'X-Frame-Options': 'DENY',
- }
+export const headers: HeadersFunction = ({ parentHeaders }) => {
+ parentHeaders.set('X-Frame-Options', 'DENY')
+ return parentHeaders
}
export async function loader({ request }: LoaderArgs) {