This commit is contained in:
GH Action - Upstream Sync
2025-08-14 01:25:03 +00:00
8 changed files with 23 additions and 7 deletions
-3
View File
@@ -1,3 +0,0 @@
import { errorHandling, telemetryData, checkKVConfig } from './utils/middleware';
export const onRequest = [checkKVConfig, errorHandling, telemetryData];
+3
View File
@@ -0,0 +1,3 @@
import { checkKVConfig } from '../utils/middleware';
export const onRequest = [checkKVConfig];
+9 -1
View File
@@ -1,11 +1,19 @@
import { fetchSecurityConfig } from "../../utils/sysConfig";
import { checkKVConfig, errorHandling } from "../../utils/middleware";
import { checkKVConfig } from "../../utils/middleware";
import { validateApiToken } from "../../utils/tokenValidator";
let securityConfig = {}
let basicUser = ""
let basicPass = ""
async function errorHandling(context) {
try {
return await context.next();
} catch (err) {
return new Response(`${err.message}\n${err.stack}`, { status: 500 });
}
}
function basicAuthentication(request) {
const Authorization = request.headers.get('Authorization');
+3
View File
@@ -0,0 +1,3 @@
import { checkKVConfig } from '../utils/middleware';
export const onRequest = [checkKVConfig];
+3
View File
@@ -0,0 +1,3 @@
import { checkKVConfig } from '../utils/middleware';
export const onRequest = [checkKVConfig];
@@ -1,5 +1,5 @@
import { fetchOthersConfig } from "./utils/sysConfig";
import { readIndex } from "./utils/indexManager";
import { fetchOthersConfig } from "../utils/sysConfig";
import { readIndex } from "../utils/indexManager";
let othersConfig = {};
let allowRandom = false;
+3
View File
@@ -0,0 +1,3 @@
import { errorHandling, telemetryData, checkKVConfig } from '../utils/middleware';
export const onRequest = [checkKVConfig, errorHandling, telemetryData];
-1
View File
@@ -1,7 +1,6 @@
import sentryPlugin from "@cloudflare/pages-plugin-sentry";
import '@sentry/tracing';
import { fetchOthersConfig } from "./sysConfig";
import { getIndexInfo, rebuildIndex } from "./indexManager";
let disableTelemetry = false;