Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(play): allow new review host #12711

Merged
merged 1 commit into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions cloud-function/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions libs/play/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" */
Expand Down Expand Up @@ -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`)
);
}

Expand Down
Loading