This commit is contained in:
MarSeventh
2024-07-20 22:26:38 +08:00
parent aa364e748e
commit d05fc0731b

View File

@@ -39,7 +39,7 @@ export async function onRequestPost(context) { // Contents of context object
// const authCode = new URLSearchParams(new URL(referer).search).get('authcode');
const authCode = new URL(request.url).searchParams.get('authcode');
const clonedRequest = request.clone();
if (!isUploadPageRequest(referer) && isAuthCodeDefined(env.AUTH_CODE) && !isValidAuthCode(env.AUTH_CODE, authCode)) {
if (isAuthCodeDefined(env.AUTH_CODE) && !isValidAuthCode(env.AUTH_CODE, authCode)) {
return new UnauthorizedException("error");
}
await errorHandling(context);