feat: Optimize var names

This commit is contained in:
butterfly
2024-04-09 18:23:52 +08:00
parent 4cb0655192
commit b175132854
6 changed files with 13 additions and 13 deletions

View File

@@ -1,12 +1,12 @@
import { NextRequest, NextResponse } from "next/server";
import { STORAGE_KEY, internalWhiteWebDavDomains } from "../../../constant";
import { STORAGE_KEY, internalWhiteWebDavEndpoints } from "../../../constant";
import { getServerSideConfig } from "@/app/config/server";
const config = getServerSideConfig();
const mergedWhiteWebDavDomains = [
...internalWhiteWebDavDomains,
...config.whiteWebDevDomains,
const mergedWhiteWebDavEndpoints = [
...internalWhiteWebDavEndpoints,
...config.whiteWebDevEndpoints,
].filter((domain) => Boolean(domain.trim()));
async function handle(
@@ -24,7 +24,7 @@ async function handle(
// Validate the endpoint to prevent potential SSRF attacks
if (
!mergedWhiteWebDavDomains.some((domain) => endpoint?.startsWith(domain))
!mergedWhiteWebDavEndpoints.some((white) => endpoint?.startsWith(white))
) {
return NextResponse.json(
{