diff options
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 |