Skip to content
Permalink
Browse files

Merge pull request #820 from mockito/release-notes-encoding

Fix GitHub release notes encoding
  • Loading branch information...
mstachniuk committed Apr 10, 2019
2 parents 99cadad + 51e332b commit 4c01bfa751de60718e8f4bb8280d23a03448b1ed
Showing with 5 additions and 4 deletions.
  1. +5 −4 subprojects/shipkit/src/main/groovy/org/shipkit/internal/util/GitHubApi.java
@@ -5,10 +5,11 @@
import org.shipkit.internal.notes.util.IOUtil;

import javax.net.ssl.HttpsURLConnection;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.Optional;

/**
@@ -56,9 +57,9 @@ private String doRequest(String relativeUrl, String method, Optional<String> bod
conn.setRequestProperty("Authorization", "token " + authToken);

if (body.isPresent()) {
try (DataOutputStream wr = new DataOutputStream(conn.getOutputStream())) {
wr.writeBytes(body.get());
wr.flush();
try (OutputStream os = conn.getOutputStream()) {
os.write(body.get().getBytes(StandardCharsets.UTF_8));
os.flush();
}
}

0 comments on commit 4c01bfa

Please sign in to comment.
You can’t perform that action at this time.