Skip to content

Commit 29e7d2a

Browse files
committed
chore(deps): remove unused body-parser dependency
1 parent ad6f30b commit 29e7d2a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

package-lock.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
"axios": "^1.6.0",
4545
"bcryptjs": "^3.0.2",
4646
"bit-mask": "^1.0.2",
47-
"body-parser": "^1.20.1",
4847
"classnames": "2.5.1",
4948
"concurrently": "^9.0.0",
5049
"connect-mongo": "^5.1.0",

src/proxy/routes/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ const validGitRequest = (url: string, headers: any): boolean => {
4949
return false;
5050
};
5151

52+
// eslint-disable-next-line no-useless-escape
5253
const isPackPost = (req: Request) =>
53-
req.method === 'POST' && /\/.*\.git\/(git-upload-pack|git-receive-pack)$/.test(req.url);
54+
req.method === 'POST' &&
55+
/^\/[^\/]+\/[^\/]+\.git\/(?:git-upload-pack|git-receive-pack)$/.test(req.url);
5456

5557
const teeAndValidate = async (req: Request, res: Response, next: NextFunction) => {
5658
if (!isPackPost(req)) return next();
@@ -140,4 +142,4 @@ export {
140142
teeAndValidate,
141143
isPackPost,
142144
stripGitHubFromGitPath,
143-
};
145+
};

0 commit comments

Comments
 (0)