Skip to content

Commit

Permalink
Fix regex pattern for extracting project ID from URL
Browse files Browse the repository at this point in the history
  • Loading branch information
ZibanPirate committed Sep 28, 2024
1 parent f43cab2 commit 69d8602
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/cloudflare/functions/projects/[slug].ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const onRequest: PagesFunction<Env> = async (context) => {

const pathName = new URL(context.request.url).pathname;

const projectIdRegex = /projects\/(.*)-(.\d)+/;
const projectIdRegex = /projects\/(.*)-(.\d+)/;
const projectId = pathName?.match(projectIdRegex)?.[2];

if (!projectId)
Expand Down

0 comments on commit 69d8602

Please sign in to comment.