Set origin based on browser origin header
This commit is contained in:
@ -17,6 +17,7 @@ export async function GenerateUploadURL(
|
||||
path: string,
|
||||
size: number,
|
||||
fileExt: string,
|
||||
origin: string,
|
||||
): Promise<string> {
|
||||
const accessToken = await GetAccessToken(env);
|
||||
const contentTypes: { [k: string]: string } = {
|
||||
@ -43,10 +44,7 @@ export async function GenerateUploadURL(
|
||||
{
|
||||
headers: {
|
||||
authorization: `Bearer ${accessToken}`,
|
||||
origin:
|
||||
typeof env.LOCAL === "undefined"
|
||||
? "https://carcrushers.cc"
|
||||
: "http://localhost:8788",
|
||||
origin,
|
||||
"x-upload-content-type": contentTypes[fileExt],
|
||||
"x-upload-content-length": size.toString(),
|
||||
},
|
||||
|
Reference in New Issue
Block a user