diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2012-03-22 14:14:33 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2012-03-22 14:33:18 +0100 |
commit | 4807b56a875275c36ad1e7aaaf5f6975fe4a4a8b (patch) | |
tree | 7081c758625812b92baf096be20651a9a613b8bd /sonar-server | |
parent | 89eddc1fcf964498e7d92ac309b62998cbdd607f (diff) | |
download | sonarqube-4807b56a875275c36ad1e7aaaf5f6975fe4a4a8b.tar.gz sonarqube-4807b56a875275c36ad1e7aaaf5f6975fe4a4a8b.zip |
Fix backward-compatibility of /api/properties
Keep status 200 when property not found
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])) } |