gitlab-org--gitlab-foss/changelogs/unreleased/blackst0ne-rails5-fix-blob-requests-format.yml
blackst0ne 037334d2f2 [Rails5] Explicitly set request.format for blob_controller
In Rails 4.2 if params[:format] is empty, Rails set it to :html
But since Rails 5.0 the framework now looks for an extension.
E.g. for `blob/master/CHANGELOG.md` in Rails 4 the format would be
`:html`, but in Rails 5 on it'd be `:md`

This commit explicitly sets the `:html` format for all requests unless
`:format` is set by a client e.g. by JS for XHR requests.
2018-06-15 16:00:20 +11:00

5 lines
127 B
YAML

---
title: "[Rails5] Explicitly set request.format for blob_controller"
merge_request: 19876
author: "@blackst0ne"
type: fixed