Skip to content

Commit

Permalink
Merge branch 'main' into malj/1932
Browse files Browse the repository at this point in the history
  • Loading branch information
millianapia authored Oct 30, 2023
2 parents 811f805 + f1088cf commit 9d6d127
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
4 changes: 3 additions & 1 deletion web/pages/magasin/index.global.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,14 @@ MagazineIndexNorwegian.getLayout = (page: AppProps) => {
)
}

export const getServerSideProps: GetServerSideProps = async ({ req, preview = false, locale = 'no' }) => {
export const getServerSideProps: GetServerSideProps = async ({ res, req, preview = false, locale = 'no' }) => {
// For the time being, let's just give 404 for satellites
// We will also return 404 if the locale is not Norwegian.
// This is a hack and and we should improve this at some point
// See https://github.com/vercel/next.js/discussions/18485

res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate')

if (locale !== 'no') {
return {
notFound: true,
Expand Down
4 changes: 3 additions & 1 deletion web/pages/magazine/index.global.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,14 @@ MagazineIndex.getLayout = (page: AppProps) => {
)
}

export const getServerSideProps: GetServerSideProps = async ({ req, preview = false, locale = 'en' }) => {
export const getServerSideProps: GetServerSideProps = async ({ res, req, preview = false, locale = 'en' }) => {
// For the time being, let's just give 404 for satellites
// We will also return 404 if the locale is not English.
// This is a hack and and we should improve this at some point
// See https://github.com/vercel/next.js/discussions/18485

res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate')

if (locale !== 'en') {
return {
notFound: true,
Expand Down
6 changes: 4 additions & 2 deletions web/pages/news/index.global.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GetServerSideProps } from 'next'
import { GetServerSideProps, GetStaticPaths } from 'next'
import { InstantSearchSSRProvider } from 'react-instantsearch-hooks-web'
import { getServerState } from 'react-instantsearch-hooks-server'
import type { AppProps } from 'next/app'
Expand Down Expand Up @@ -67,12 +67,14 @@ NewsRoom.getLayout = (page: AppProps) => {
)
}

export const getServerSideProps: GetServerSideProps = async ({ req, preview = false, locale = 'en' }) => {
export const getServerSideProps: GetServerSideProps = async ({ res, req, preview = false, locale = 'en' }) => {
// For the time being, let's just give 404 for satellites
// We will also return 404 if the locale is not English.
// This is a hack and and we should improve this at some point
// See https://github.com/vercel/next.js/discussions/18485

res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate')

if (locale !== 'en') {
return {
notFound: true,
Expand Down
5 changes: 4 additions & 1 deletion web/pages/nyheter/index.global.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,14 @@ NorwegianNewsRoom.getLayout = (page: AppProps) => {
)
}

export const getServerSideProps: GetServerSideProps = async ({ req, preview = false, locale = 'no' }) => {
export const getServerSideProps: GetServerSideProps = async ({ res, req, preview = false, locale = 'no' }) => {
// For the time being, let's just give 404 for satellites
// We will also return 404 if the locale is not Norwegian.
// This is a hack, and we should improve this at some point
// See https://github.com/vercel/next.js/discussions/18485

res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate')

if (locale !== 'no') {
return {
notFound: true,
Expand Down

0 comments on commit 9d6d127

Please sign in to comment.