Merge remote-tracking branch 'upstream/main' into dev

# Conflicts:
#	app/components/chat.tsx
#	app/components/home.tsx
#	app/components/settings.tsx
#	app/components/sidebar.tsx
#	app/config/server.ts
#	app/constant.ts
#	app/layout.tsx
#	app/store/access.ts
#	app/utils/model.ts
This commit is contained in:
sijinhui
2024-07-25 21:22:36 +08:00
35 changed files with 1789 additions and 190 deletions

View File

@@ -37,9 +37,13 @@ async function handle(
const normalizedAllowedEndpoint = normalizeUrl(allowedEndpoint);
const normalizedEndpoint = normalizeUrl(endpoint as string);
return normalizedEndpoint &&
return (
normalizedEndpoint &&
normalizedEndpoint.hostname === normalizedAllowedEndpoint?.hostname &&
normalizedEndpoint.pathname.startsWith(normalizedAllowedEndpoint.pathname);
normalizedEndpoint.pathname.startsWith(
normalizedAllowedEndpoint.pathname,
)
);
})
) {
return NextResponse.json(