Skip to content

Commit

Permalink
chore: rename api route
Browse files Browse the repository at this point in the history
  • Loading branch information
chambaz committed Nov 14, 2024
1 parent c629605 commit 744fe76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions apps/marginfi-v2-trading/src/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { NextRequest, NextResponse } from "next/server";

export const config = {
matcher: ["/", "/index", "/yield", "/portfolio", "/trade/:path*", "/api/rpc"],
matcher: ["/", "/index", "/yield", "/portfolio", "/trade/:path*", "/api/proxy"],
};

const restrictedCountries = ["US", "VE", "CU", "IR", "KP", "SY"];

const allowedOrigins = ["https://www.thearena.trade", "https://staging.thearena.trade", "http://localhost:3006"];

export function middleware(req: NextRequest) {
if (req.nextUrl.pathname.startsWith("/api/rpc")) {
if (req.nextUrl.pathname.startsWith("/api/proxy")) {
const origin = req.headers.get("origin") ?? "";

if (!allowedOrigins.includes(origin)) {
Expand Down
4 changes: 2 additions & 2 deletions apps/marginfi-v2-ui/src/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NextRequest, NextResponse } from "next/server";

export const config = {
matcher: ["/", "/index", "/stake", "/swap", "/bridge", "/earn", "/points", "/looper", "/api/rpc"],
matcher: ["/", "/index", "/stake", "/swap", "/bridge", "/earn", "/points", "/looper", "/api/proxy"],
};

const restrictedCountries = ["VE", "CU", "IR", "KP", "SY"];
Expand All @@ -15,7 +15,7 @@ const allowedOrigins = [
];

export function middleware(req: NextRequest) {
if (req.nextUrl.pathname.startsWith("/api/rpc")) {
if (req.nextUrl.pathname.startsWith("/api/proxy")) {
const origin = req.headers.get("origin") ?? "";

if (!allowedOrigins.includes(origin)) {
Expand Down

0 comments on commit 744fe76

Please sign in to comment.