Skip to content

Fix 500 error for diff_files endpoint

Vasilii Iakliushin requested to merge fix_template_error into master

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

  1. Visit link: http://127.0.0.1:3000/root/gitlab-test/-/commit/ddd0f15ae83993f5cb66a927a28673882e99100b/diff_files.json
  2. 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.

Edited by Vasilii Iakliushin

Merge request reports