diff options
author | Guillaume Jambet <guillaume.jambet@sonarsource.com> | 2017-11-03 17:28:21 +0100 |
---|---|---|
committer | Guillaume Jambet <guillaume.jambet@gmail.com> | 2017-11-08 13:51:31 +0100 |
commit | e9de4d178493dc10e411e9135159319e8e6873cb (patch) | |
tree | fbc86867a8d6c60b9a9572c2d3553f987a5d9240 /server | |
parent | 2f2bee91083c3e6f0ed2c195bd5e2aebbe5e4be2 (diff) | |
download | sonarqube-e9de4d178493dc10e411e9135159319e8e6873cb.tar.gz sonarqube-e9de4d178493dc10e411e9135159319e8e6873cb.zip |
SONAR-10040 add length validation to Settings ws
Diffstat (limited to 'server')
-rw-r--r-- | server/sonar-server/src/main/java/org/sonar/server/setting/ws/SetAction.java | 2 |
1 files changed, 2 insertions, 0 deletions
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<CharSequence, ?, String> 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"); |