Skip to content

Commit 30c0cdc

Browse files
committed
fix: for any path param name
1 parent d7b1089 commit 30c0cdc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/frameworks-express/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,5 +206,7 @@ export async function getSession(
206206
}
207207

208208
function getBasePath(req: e.Request) {
209-
return req.baseUrl.split(req.params.path[0])[0].replace(/\/$/, "")
209+
const paramKey = Object.keys(req.params)[0]
210+
const paramValue = req.params[paramKey][0]
211+
return req.baseUrl.split(paramValue)[0].replace(/\/$/, "")
210212
}

0 commit comments

Comments
 (0)