We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 08150c8 commit cb7d88cCopy full SHA for cb7d88c
web/api/share.ts
@@ -2,12 +2,13 @@ import { put } from "@vercel/blob";
2
import { createHash } from "crypto";
3
4
const MAX_DATA_SIZE = 5 * 1024 * 1024; // 5MB
5
-const AllowedOrigin = process.env.VERCEL_URL ?? "http://localhost";
+const AllowedOrigin = process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` : "http://localhost";
6
+const productionOrigin = "https://overlay.speakeasy.com";
7
8
export function POST(request: Request) {
9
const origin = request.headers.get("Origin");
10
- if (!origin || !origin.includes(AllowedOrigin)) {
11
+ if (!origin || (!origin.startsWith(AllowedOrigin) && !origin.startsWith(productionOrigin))) {
12
return new Response("Unauthorized", { status: 403 });
13
}
14
0 commit comments