From e9de4d178493dc10e411e9135159319e8e6873cb Mon Sep 17 00:00:00 2001 From: Guillaume Jambet Date: Fri, 3 Nov 2017 17:28:21 +0100 Subject: SONAR-10040 add length validation to Settings ws --- .../src/main/java/org/sonar/server/setting/ws/SetAction.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'server') diff --git a/server/sonar-server/src/main/java/org/sonar/server/setting/ws/SetAction.java b/server/sonar-server/src/main/java/org/sonar/server/setting/ws/SetAction.java index b255d1ecafe..a4e23832f45 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/setting/ws/SetAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/setting/ws/SetAction.java @@ -71,6 +71,7 @@ import static org.sonarqube.ws.client.setting.SettingsWsParameters.PARAM_VALUES; public class SetAction implements SettingsWsAction { private static final Collector COMMA_JOINER = Collectors.joining(","); private static final String MSG_NO_EMPTY_VALUE = "A non empty value must be provided"; + private static final int VALUE_MAXIMUM_LENGTH = 4000; private final PropertyDefinitions propertyDefinitions; private final DbClient dbClient; @@ -114,6 +115,7 @@ public class SetAction implements SettingsWsAction { .setRequired(true); action.createParam(PARAM_VALUE) + .setMaximumLength(VALUE_MAXIMUM_LENGTH) .setDescription("Setting value. To reset a value, please use the reset web service.") .setExampleValue("git@github.com:SonarSource/sonarqube.git"); -- cgit v1.2.3