remove query params from path param if present

This commit is contained in:
HorizonCode 2023-05-12 12:12:35 +02:00
parent 1c668e5892
commit 0675b26dad

2
mod.ts
View File

@ -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, ""),
};
},
{},