From 3aa90e712ac55f8bed34ef6be00386eb571c18fa Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Mon, 9 Nov 2020 11:34:20 +0100 Subject: [PATCH 1/2] fix: use neutral Locale for String operations --- sentry/src/main/java/io/sentry/Breadcrumb.java | 2 +- .../io/sentry/config/EnvironmentVariablePropertiesProvider.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sentry/src/main/java/io/sentry/Breadcrumb.java b/sentry/src/main/java/io/sentry/Breadcrumb.java index 996c374493..cfa4e51a15 100644 --- a/sentry/src/main/java/io/sentry/Breadcrumb.java +++ b/sentry/src/main/java/io/sentry/Breadcrumb.java @@ -55,7 +55,7 @@ public Breadcrumb(final @Nullable Date timestamp) { breadcrumb.setType("http"); breadcrumb.setCategory("http"); breadcrumb.setData("url", url); - breadcrumb.setData("method", method.toUpperCase(Locale.getDefault())); + breadcrumb.setData("method", method.toUpperCase(Locale.ROOT)); return breadcrumb; } diff --git a/sentry/src/main/java/io/sentry/config/EnvironmentVariablePropertiesProvider.java b/sentry/src/main/java/io/sentry/config/EnvironmentVariablePropertiesProvider.java index 1abc2e8fd7..4294a47988 100644 --- a/sentry/src/main/java/io/sentry/config/EnvironmentVariablePropertiesProvider.java +++ b/sentry/src/main/java/io/sentry/config/EnvironmentVariablePropertiesProvider.java @@ -15,7 +15,7 @@ final class EnvironmentVariablePropertiesProvider implements PropertiesProvider @Override public @Nullable String getProperty(@NotNull String property) { return StringUtils.removeSurrounding( - System.getenv(PREFIX + "_" + property.replace(".", "_").toUpperCase(Locale.getDefault())), + System.getenv(PREFIX + "_" + property.replace(".", "_").toUpperCase(Locale.ROOT)), "\""); } } From 8988a944a7897c9a3a852b0f55de3b6a16e7f28b Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Thu, 12 Nov 2020 16:12:29 +0100 Subject: [PATCH 2/2] fix --- CHANGELOG.md | 1 + .../sentry/config/EnvironmentVariablePropertiesProvider.java | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 18d17e3013..da8d9b183d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ * Increase max cached events to 30 (#1029) * Normalize DSN URI (#1030) +* fix: use neutral Locale for String operations #1033 # 3.1.2 diff --git a/sentry/src/main/java/io/sentry/config/EnvironmentVariablePropertiesProvider.java b/sentry/src/main/java/io/sentry/config/EnvironmentVariablePropertiesProvider.java index 4294a47988..41ed662b6e 100644 --- a/sentry/src/main/java/io/sentry/config/EnvironmentVariablePropertiesProvider.java +++ b/sentry/src/main/java/io/sentry/config/EnvironmentVariablePropertiesProvider.java @@ -15,7 +15,6 @@ final class EnvironmentVariablePropertiesProvider implements PropertiesProvider @Override public @Nullable String getProperty(@NotNull String property) { return StringUtils.removeSurrounding( - System.getenv(PREFIX + "_" + property.replace(".", "_").toUpperCase(Locale.ROOT)), - "\""); + System.getenv(PREFIX + "_" + property.replace(".", "_").toUpperCase(Locale.ROOT)), "\""); } }