Skip to content

Commit 8700c11

Browse files
URLDecode remaining /vault/ and /open/ paths. Fixes #138.
1 parent 2179e68 commit 8700c11

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/requestHandler.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,9 @@ export default class RequestHandler {
332332
}
333333

334334
async vaultGet(req: express.Request, res: express.Response): Promise<void> {
335-
const path = req.path.slice(req.path.indexOf("/", 1) + 1);
335+
const path = decodeURIComponent(
336+
req.path.slice(req.path.indexOf("/", 1) + 1)
337+
);
336338

337339
return this._vaultGet(path, req, res);
338340
}
@@ -1060,7 +1062,9 @@ export default class RequestHandler {
10601062
}
10611063

10621064
async openPost(req: express.Request, res: express.Response): Promise<void> {
1063-
const path = req.path.slice(req.path.indexOf("/", 1) + 1);
1065+
const path = decodeURIComponent(
1066+
req.path.slice(req.path.indexOf("/", 1) + 1)
1067+
);
10641068

10651069
const query = queryString.parseUrl(req.originalUrl, {
10661070
parseBooleans: true,

0 commit comments

Comments
 (0)