Skip to content

Commit 298b38c

Browse files
lucamilanesiodpursehouse
authored andcommitted
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
1 parent b664b37 commit 298b38c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/AuthenticatedLoginHttpResponse.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
import java.io.ByteArrayOutputStream;
1717
import java.io.IOException;
18+
import java.io.OutputStreamWriter;
1819
import java.io.PrintWriter;
1920
import java.util.Collection;
2021
import java.util.Collections;
@@ -174,7 +175,8 @@ public ServletResponse getResponse() {
174175

175176
@Override
176177
public PrintWriter getWriter() throws IOException {
177-
return new PrintWriter(outputStream);
178+
return new PrintWriter(new OutputStreamWriter(outputStream,
179+
characterEncoding));
178180
}
179181

180182
@Override

0 commit comments

Comments
 (0)