Fix 500 error for diff_files endpoint
What does this MR do and why?
Problem
We don't define accepted formats for this endpoint. It leads to 500 errors when unsupported format is requested.
Solution
Use respond_to
method to explicitly allow only html format.
How to set up and validate locally
- Visit link: http://127.0.0.1:3000/root/gitlab-test/-/commit/ddd0f15ae83993f5cb66a927a28673882e99100b/diff_files.json
- You should see 404 page with the fix, but 500 error without.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Vasilii Iakliushin