From 0675b26dad46c6169fc92212d2d70e8af0713084 Mon Sep 17 00:00:00 2001 From: HorizonCode Date: Fri, 12 May 2023 12:12:35 +0200 Subject: [PATCH] remove query params from path param if present --- mod.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod.ts b/mod.ts index 008ee3f..0d7d53e 100644 --- a/mod.ts +++ b/mod.ts @@ -198,7 +198,7 @@ export class HTTPServer { (accum: { [key: string]: string }, curr: RouteParam) => { return { ...accum, - [curr.paramKey]: routeSegments[curr.idx], + [curr.paramKey]: routeSegments[curr.idx].replace(/(?!\/)\W\D.*/gm, ""), }; }, {},