Skip to content

[Rails5] Set request.format in commits_controller

What does this MR do?

Since Rails 5.0 request.format is being set depending on the route extension.

In commits pages we pass a ref as a URL parameter. If the ref is an extension-like, Rails converts it and sets to request.format.

E.g. if the ref is some_branch.atom, Rails starts responding with atom format, but it should response with html because .atom is the part of ref name, not the format.

This MR explicitly sets request.format to :html when needed.

Are there points in the code the reviewer needs to double check?

No.

Why was this MR needed?

Migration to Rails 5.0.

Screenshots (if relevant)

No.

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #48144 (closed) and #48143 (closed)

Edited by blackst0ne

Merge request reports