diff options
Diffstat (limited to 'sonar-server')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/controllers/api/properties_controller.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/properties_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/properties_controller.rb index cb5586a9524..916340b184b 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/properties_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/properties_controller.rb @@ -46,7 +46,15 @@ class Api::PropertiesController < Api::ApiController else prop = Property.by_key(key) end - not_found('property not found') unless prop + unless prop + # for backward-compatibility with versions <= 2.14 : keep status 200 + message = "Property not found: #{key}" + return respond_to do |format| + format.json { render :json => error_to_json(404, message), :status => 200 } + format.xml { render :xml => error_to_xml(404, message), :status => 200 } + format.text { render :text => message, :status => 200 } + end + end access_denied unless viewable?(key) respond_to do |format| format.json { render :json => jsonp(to_json([prop])) } |