Respond with a 404 when requested file is not found instead of crashing
This commit is contained in:
parent
6d34829263
commit
ebed818824
@ -32,6 +32,8 @@ export default class GiteaRepoLatestReleaseController extends Controller {
|
||||
data += c;
|
||||
});
|
||||
r.on('end', async () => {
|
||||
if (r.statusCode === 404) return next(new NotFoundHttpError('file', req.url));
|
||||
|
||||
try {
|
||||
const releases = JSON.parse(data);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user