Fix path segment check
This commit is contained in:
parent
202b8aa78d
commit
7a9ea0449e
@ -4,7 +4,7 @@ export async function onRequest(context: RequestContext) {
|
||||
const pathSegments = new URL(context.request.url).pathname.split("/");
|
||||
|
||||
// Skip checks for the by-id endpoint
|
||||
if (pathSegments.length > 5) return await context.next();
|
||||
if (pathSegments.length <= 5) return await context.next();
|
||||
|
||||
const eventInfo = await context.env.D1.prepare(
|
||||
"SELECT * FROM events WHERE id = ?;",
|
||||
|
Loading…
x
Reference in New Issue
Block a user