Skip to content

Commit

Permalink
chore: prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasRooney committed Jan 11, 2025
1 parent cb7d88c commit c629b00
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions web/api/share.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@ import { put } from "@vercel/blob";
import { createHash } from "crypto";

const MAX_DATA_SIZE = 5 * 1024 * 1024; // 5MB
const AllowedOrigin = process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` : "http://localhost";
const AllowedOrigin = process.env.VERCEL_URL
? `https://${process.env.VERCEL_URL}`
: "http://localhost";
const productionOrigin = "https://overlay.speakeasy.com";

export function POST(request: Request) {
const origin = request.headers.get("Origin");

if (!origin || (!origin.startsWith(AllowedOrigin) && !origin.startsWith(productionOrigin))) {
if (
!origin ||
(!origin.startsWith(AllowedOrigin) && !origin.startsWith(productionOrigin))
) {
return new Response("Unauthorized", { status: 403 });
}

Expand Down

0 comments on commit c629b00

Please sign in to comment.