From c6dc1f17c379b45c127eb35a0d9d887d097aeaf5 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Tue, 8 Apr 2014 11:45:41 +0200 Subject: [PATCH] SONAR-4807 Fix api/sources WS when resource parameter is missing --- .../webapp/WEB-INF/app/controllers/api/sources_controller.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/sources_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/sources_controller.rb index 8daa9ab3325..772fbb04d17 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/sources_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/sources_controller.rb @@ -23,6 +23,11 @@ require "json" class Api::SourcesController < Api::RestController def rest_call + unless params[:resource] + rest_status_ko('Missing parameter: resource', 400) + return + end + resource_id=params[:resource] if resource_id @resource=Project.by_key(resource_id) -- 2.39.5