fix: change matching pattern

This commit is contained in:
Fred
2024-03-14 01:22:50 +08:00
parent eebc334e02
commit 8645214654
3 changed files with 13 additions and 5 deletions

View File

@@ -12,7 +12,7 @@ async function handle(
}
const [action, ...key] = params.key;
// only allow to request to *.upstash.io
if (!endpoint || !endpoint.endsWith("upstash.io")) {
if (!endpoint || !new URL(endpoint).hostname.endsWith(".upstash.io")) {
return NextResponse.json(
{
error: true,