<!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Make sure it's not mentioned in the FAQ (https://docs.gitea.io/en-us/faq) 5. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.13.6 - Git version: 2.20.1-2+deb10u3 - Operating system: Debian 10 - I downloaded and installed Gitea using the instructions in [Installation from binary](https://docs.gitea.io/en-us/install-from-binary/). - Gitea is run by systemd <!-- Please include information on whether you built gitea yourself, used one of our downloads or are using some other package --> <!-- Please also tell us how you are running gitea, e.g. if it is being run from docker, a command-line, systemd etc. ---> <!-- If you are using a package or systemd tell us what distribution you are using --> - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [x] Yes (provide example URL) - [Example URL](https://try.gitea.io/nguyena/code-server/commit/18ace7b9066c4492a61db4dbae3b49ad477891b4.diff) (I picked a random repo) - [ ] No - Log gist: https://gist.github.com/BBaoVanC/f9c4c1275561a5dbd17f858468c2b19b <!-- It really is important to provide pertinent logs --> <!-- Please read https://docs.gitea.io/en-us/logging-configuration/#debugging-problems --> <!-- In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini --> ## Description <!-- If using a proxy or a CDN (e.g. CloudFlare) in front of gitea, please disable the proxy/CDN fully and connect to gitea directly to confirm the issue still persists without those services. --> If you try to download the diff or patch of a commit that doesn't exist, then you get a 500. I would expect it to return a 404. <!-- ## Screenshots --> <!-- **If this issue involves the Web Interface, please include a screenshot** -->