From 8c46c9f41dd7e86ef112e22a2fbe9d91f4a1c441 Mon Sep 17 00:00:00 2001 From: Claas Augner Date: Mon, 3 Mar 2025 10:09:54 +0100 Subject: [PATCH] chore(play): allow new review host Also removes ORIGIN_REVIEW environment variable. --- cloud-function/README.md | 2 -- libs/play/index.js | 7 +++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/cloud-function/README.md b/cloud-function/README.md index 925fdc3a5110..5b379aa514a9 100644 --- a/cloud-function/README.md +++ b/cloud-function/README.md @@ -36,8 +36,6 @@ The function uses the following environment variables: requests to the main site. - `ORIGIN_LIVE_SAMPLES` (default: `"localhost"`) - The expected `Host` header value for requests to live samples. -- `ORIGIN_REVIEW` (default: `"content.dev.mdn.mozit.cloud"`) - The host of the - content preview pages. - `SOURCE_CONTENT` (default: `"http://localhost:8100"`) - The URL at which the client build is served. - `SOURCE_API` (default: `"https://developer.allizom.org/"`) - The URL at which diff --git a/libs/play/index.js b/libs/play/index.js index f7d1c3e8f799..1eeddab11858 100644 --- a/libs/play/index.js +++ b/libs/play/index.js @@ -4,8 +4,6 @@ import he from "he"; export const ORIGIN_PLAY = process.env["ORIGIN_PLAY"] || "localhost"; export const ORIGIN_MAIN = process.env["ORIGIN_MAIN"] || "localhost"; -export const ORIGIN_REVIEW = - process.env["ORIGIN_REVIEW"] || "content.dev.mdn.mozit.cloud"; /** @import { IncomingMessage, ServerResponse } from "http" */ /** @import * as express from "express" */ @@ -474,8 +472,9 @@ function isMDNReferer(referer) { const { hostname } = referer; return ( hostname === ORIGIN_MAIN || - hostname === ORIGIN_REVIEW || - hostname.endsWith(`.${ORIGIN_REVIEW}`) + // Review Companion (old/new). + hostname.endsWith(`.content.dev.mdn.mozit.cloud`) || + hostname.endsWith(`.review.mdn.allizom.net`) ); }