fix: prevent local fallbacks in production
This commit is contained in:
parent
04c08ff256
commit
c044ee2c40
@ -83,12 +83,7 @@ async function readLocalFallbackFavicon() {
|
||||
export async function GET(request: Request) {
|
||||
try {
|
||||
const requestUrl = new URL(request.url);
|
||||
if (
|
||||
process.env.CANVAS_E2E_LOCAL === "true" ||
|
||||
requestUrl.hostname === "127.0.0.1" ||
|
||||
requestUrl.hostname === "localhost" ||
|
||||
requestUrl.hostname === "::1"
|
||||
) {
|
||||
if (process.env.CANVAS_E2E_LOCAL === "true") {
|
||||
return await readLocalFallbackFavicon();
|
||||
}
|
||||
|
||||
|
||||
@ -1010,11 +1010,7 @@ export async function GET(request: NextRequest) {
|
||||
try {
|
||||
const startedAt = Date.now();
|
||||
const scope = request.nextUrl.searchParams.get("scope") || "";
|
||||
const isLocalCanvasE2E =
|
||||
process.env.CANVAS_E2E_LOCAL === "true" ||
|
||||
request.nextUrl.hostname === "127.0.0.1" ||
|
||||
request.nextUrl.hostname === "localhost" ||
|
||||
request.nextUrl.hostname === "::1";
|
||||
const isLocalCanvasE2E = process.env.CANVAS_E2E_LOCAL === "true";
|
||||
|
||||
if (
|
||||
isLocalCanvasE2E &&
|
||||
|
||||
@ -22,14 +22,9 @@ import { defaultPointsSystemConfig } from "@/lib/points/config";
|
||||
const MEMBERSHIP_CONFIG_KEY = "membership_config";
|
||||
const MEMBERSHIP_USER_OVERRIDES_KEY = "membership_user_plan_overrides";
|
||||
|
||||
export async function GET(request: Request) {
|
||||
export async function GET() {
|
||||
try {
|
||||
const requestHost = new URL(request.url).hostname;
|
||||
const isLocalCanvasE2E =
|
||||
process.env.CANVAS_E2E_LOCAL === "true" ||
|
||||
requestHost === "127.0.0.1" ||
|
||||
requestHost === "localhost" ||
|
||||
requestHost === "::1";
|
||||
const isLocalCanvasE2E = process.env.CANVAS_E2E_LOCAL === "true";
|
||||
|
||||
if (isLocalCanvasE2E) {
|
||||
const currentPlan = getMembershipPlanById(defaultMembershipConfig, "pro");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user