MCPcopy
hub / github.com/QwikDev/qwik / fixPath

Function fixPath

packages/qwik-city/src/middleware/aws-lambda/index.ts:30–41  ·  view source on GitHub ↗
(pathT: string)

Source from the content-addressed store, hash-verified

28 });
29
30 const fixPath = (pathT: string) => {
31 if (opts.qwikCityPlan.trailingSlash) {
32 const url = new URL(pathT, 'http://aws-qwik.local');
33 if (url.pathname.includes('.', url.pathname.lastIndexOf('/'))) {
34 return pathT;
35 }
36 if (!url.pathname.endsWith('/')) {
37 return url.pathname + '/' + url.search;
38 }
39 }
40 return pathT;
41 };
42
43 const handle = (req: any, res: any) => {
44 req.url = fixPath(req.url);

Callers 1

handleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…