Handle Invalid LFS Batch Objects

What does this MR do and why?

Problem

LFS batch requests with objects sent as a hash caused a 500 because ActionController::Parameters does not support to_a. These requests should return the existing 404 response for invalid object collections.

Solution

  • Convert objects only when Array.try_convert accepts the value.
  • Treat non-array object input as empty.
  • Add request specs for hash and numeric-keyed hash payloads.

References

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist.

Edited by Vasilii Iakliushin

Merge request reports

Loading
Loading