Skip to content

Commit

Permalink
fix: add language to headers (#4148)
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinBuyck authored Jun 19, 2024
1 parent 4dbb6e3 commit f5c2ee6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sites/public/src/pages/preview/listings/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,17 @@ export default function ListingPage(props: ListingProps) {
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export async function getServerSideProps(context: { params: Record<string, string>; req: any }) {
export async function getServerSideProps(context: {
params: Record<string, string>
locale: string
req: any
}) {
let response

try {
response = await axios.get(`${process.env.backendApiBase}/listings/${context.params.id}`, {
headers: {
language: context.locale,
passkey: process.env.API_PASS_KEY,
"x-forwarded-for":
context.req.headers["x-forwarded-for"] ?? context.req.socket.remoteAddress,
Expand Down

0 comments on commit f5c2ee6

Please sign in to comment.