Skip to content

Commit

Permalink
Set encoding explicitly for spotbugs
Browse files Browse the repository at this point in the history
  • Loading branch information
timja committed Jan 29, 2020
1 parent 079bcb8 commit 699da43
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import static java.lang.Math.abs;

import java.nio.charset.Charset;
import java.util.Base64;
import java.util.concurrent.TimeUnit;
import javax.crypto.Cipher;
Expand Down Expand Up @@ -98,7 +100,7 @@ public static void setAnnotator(ConsoleAnnotator<?> annotator) throws IOExceptio
}
StaplerResponse rsp = Stapler.getCurrentResponse();
if (rsp != null) {
rsp.setHeader("X-ConsoleAnnotator", new String(Base64.getEncoder().encode(baos.toByteArray())));
rsp.setHeader("X-ConsoleAnnotator", new String(Base64.getEncoder().encode(baos.toByteArray()), Charset.defaultCharset()));
}
}

Expand Down

0 comments on commit 699da43

Please sign in to comment.