diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-23 12:08:41 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-23 12:08:41 +0300 |
commit | ca7bdd871e35d2a0b079cf7622df10f72f8a5d0f (patch) | |
tree | 666704be546e69df022fbfc2cc00531f2f7bb770 /lib/api/api.rb | |
parent | bde2d0d618efdb2a6c1f14a9f660f2dc84c0c643 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api/api.rb')
-rw-r--r-- | lib/api/api.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/api/api.rb b/lib/api/api.rb index 84b4d5a5835..ec252faa6cb 100644 --- a/lib/api/api.rb +++ b/lib/api/api.rb @@ -115,7 +115,14 @@ module API format :json formatter :json, Gitlab::Json::GrapeFormatter - content_type :txt, "text/plain" + + # There is a small chance some users depend on the old behavior. + # We this change under a feature flag to see if affects GitLab.com users. + if Feature.enabled?(:api_json_content_type) + content_type :json, 'application/json' + else + content_type :txt, 'text/plain' + end # Ensure the namespace is right, otherwise we might load Grape::API::Helpers helpers ::API::Helpers |