From 5bbaa12ae6972d3cf4dff4d2db72e3054e5d32f5 Mon Sep 17 00:00:00 2001 From: "Malvik, Sven" Date: Fri, 1 Jun 2018 23:06:08 +0200 Subject: [PATCH] Added charset UTF-8 in requestBuilder --- src/main/java/org/sonar/plugins/stash/client/StashClient.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/org/sonar/plugins/stash/client/StashClient.java b/src/main/java/org/sonar/plugins/stash/client/StashClient.java index fb526158..a46260f2 100644 --- a/src/main/java/org/sonar/plugins/stash/client/StashClient.java +++ b/src/main/java/org/sonar/plugins/stash/client/StashClient.java @@ -1,5 +1,6 @@ package org.sonar.plugins.stash.client; +import java.nio.charset.StandardCharsets; import java.util.Optional; import org.asynchttpclient.AsyncHttpClient; import org.asynchttpclient.BoundRequestBuilder; @@ -351,6 +352,7 @@ private JsonObject performRequest(BoundRequestBuilder requestBuilder, requestBuilder.setFollowRedirect(true); requestBuilder.addHeader("Content-Type", JSON.toString()); requestBuilder.addHeader("Accept", JSON.toString()); + requestBuilder.setCharset(StandardCharsets.UTF_8); Request request = requestBuilder.build(); MDC.put(MDC_URL_KEY, request.getUrl());