File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -2,13 +2,18 @@ import { put } from "@vercel/blob";
2
2
import { createHash } from "crypto" ;
3
3
4
4
const MAX_DATA_SIZE = 5 * 1024 * 1024 ; // 5MB
5
- const AllowedOrigin = process . env . VERCEL_URL ? `https://${ process . env . VERCEL_URL } ` : "http://localhost" ;
5
+ const AllowedOrigin = process . env . VERCEL_URL
6
+ ? `https://${ process . env . VERCEL_URL } `
7
+ : "http://localhost" ;
6
8
const productionOrigin = "https://overlay.speakeasy.com" ;
7
9
8
10
export function POST ( request : Request ) {
9
11
const origin = request . headers . get ( "Origin" ) ;
10
12
11
- if ( ! origin || ( ! origin . startsWith ( AllowedOrigin ) && ! origin . startsWith ( productionOrigin ) ) ) {
13
+ if (
14
+ ! origin ||
15
+ ( ! origin . startsWith ( AllowedOrigin ) && ! origin . startsWith ( productionOrigin ) )
16
+ ) {
12
17
return new Response ( "Unauthorized" , { status : 403 } ) ;
13
18
}
14
19
You can’t perform that action at this time.
0 commit comments