diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2019-08-02 09:49:32 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-08-02 20:21:15 +0200 |
commit | 09534faa716dc27bdcc9597cbe27cbae672267f5 (patch) | |
tree | 728fb40d667b8befad3779dbfcd62887c4f882cf /server/sonar-server | |
parent | 8f9987656c0f49be16c6ab241e7408b2faa7c90c (diff) | |
download | sonarqube-09534faa716dc27bdcc9597cbe27cbae672267f5.tar.gz sonarqube-09534faa716dc27bdcc9597cbe27cbae672267f5.zip |
SONAR-12370 Prevent potential vulnerability with web API api/l10n/index
Diffstat (limited to 'server/sonar-server')
-rw-r--r-- | server/sonar-server/src/main/java/org/sonar/server/platform/ws/IndexAction.java | 2 | ||||
-rw-r--r-- | server/sonar-server/src/test/java/org/sonar/server/platform/ws/IndexActionTest.java | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/ws/IndexAction.java b/server/sonar-server/src/main/java/org/sonar/server/platform/ws/IndexAction.java index 27f121ca85c..dc194a049a0 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/platform/ws/IndexAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/platform/ws/IndexAction.java @@ -71,7 +71,7 @@ public class IndexAction implements WsAction { } String localeParam = request.mandatoryParam(LOCALE_PARAM); Locale locale = Locale.forLanguageTag(localeParam); - checkArgument(!locale.getISO3Language().isEmpty(), "'%s' cannot be parsed as a BCP47 language tag", localeParam); + checkArgument(!locale.getISO3Language().isEmpty(), "Locale cannot be parsed as a BCP47 language tag"); try (JsonWriter json = response.newJsonWriter()) { json.beginObject(); diff --git a/server/sonar-server/src/test/java/org/sonar/server/platform/ws/IndexActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/platform/ws/IndexActionTest.java index d950ea2c7d5..fd672900e98 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/platform/ws/IndexActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/platform/ws/IndexActionTest.java @@ -134,7 +134,7 @@ public class IndexActionTest { when(i18n.getEffectiveLocale(UK)).thenReturn(UK); expectedException.expect(IllegalArgumentException.class); - expectedException.expectMessage("'en_GB' cannot be parsed as a BCP47 language tag"); + expectedException.expectMessage("Locale cannot be parsed as a BCP47 language tag"); call("en_GB", null); } |