commit | 298b38c2cda2a15c8297bb7df87e192012d76e71 | [log] [tgz] |
---|---|---|
author | Luca Milanesio <luca.milanesio@gmail.com> | Fri Aug 08 08:43:20 2014 +0100 |
committer | David Pursehouse <david.pursehouse@sonymobile.com> | Tue Aug 19 08:58:25 2014 +0000 |
tree | 065d239f83ea55405096d2c175d2fb4b0036bf75 | |
parent | b664b37ca5b3da2dcb8dca9e71bf733ed2c6f990 [diff] |
FindBugs error: include encoding for wrapped login response When wrapping the login response (with added HTTP headers) we need to include the target encoding otherwise we will default to the JVM encoding instead of the one set into the HTTP response. Change-Id: I81c2ec44e1c7ed62e14faeba5dd13a14468b95b1
diff --git a/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/AuthenticatedLoginHttpResponse.java b/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/AuthenticatedLoginHttpResponse.java index 5e4b586..e9bd369 100644 --- a/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/AuthenticatedLoginHttpResponse.java +++ b/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/AuthenticatedLoginHttpResponse.java
@@ -15,6 +15,7 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.Collection; import java.util.Collections; @@ -174,7 +175,8 @@ @Override public PrintWriter getWriter() throws IOException { - return new PrintWriter(outputStream); + return new PrintWriter(new OutputStreamWriter(outputStream, + characterEncoding)); } @Override