diff options
author | HampusM <hampus@hampusmat.com> | 2021-06-21 15:40:20 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2021-06-21 15:40:20 +0200 |
commit | 647a916b251f0b1af1a59874fabb4cf8ebb245d9 (patch) | |
tree | 4e7af425b2e317140a6f04d95ae174ba7df256a9 /packages/server/src/app.ts | |
parent | b3a7231dbecac28ee8090f6ee84e618037f8267a (diff) |
Improved backend error handling
Diffstat (limited to 'packages/server/src/app.ts')
-rw-r--r-- | packages/server/src/app.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/server/src/app.ts b/packages/server/src/app.ts index 263703b..3cb1c07 100644 --- a/packages/server/src/app.ts +++ b/packages/server/src/app.ts @@ -81,7 +81,7 @@ fastify.route({ reply.header("Content-Type", "application/x-git-upload-pack-advertisement"); const repo_verification = await verifyRepoName(settings.base_dir, (<any>req).params.repo); - if(repo_verification.success === false) { + if(repo_verification.success === false && repo_verification.code) { reply.code(repo_verification.code).send(repo_verification.message); } @@ -108,7 +108,7 @@ fastify.route({ url: "/:repo([a-zA-Z0-9\\.\\-_]+)/git-upload-pack", handler: async(req, reply) => { const repo_verification = await verifyRepoName(settings.base_dir, (<any>req).params.repo); - if(repo_verification.success === false) { + if(repo_verification.success === false && repo_verification.code) { reply.header("Content-Type", "application/x-git-upload-pack-result"); reply.code(repo_verification.code).send(repo_verification.message); } |