Skip to content

Commit

Permalink
Be more generous about incoming Base64
Browse files Browse the repository at this point in the history
Notably, the python base64 encoder outputs something
that maps to Java 8's MIME decoder.
  • Loading branch information
shs96c committed Oct 11, 2016
1 parent 30f139a commit 10f20c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion java/client/src/org/openqa/selenium/OutputType.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public String toString() {
*/
OutputType<byte[]> BYTES = new OutputType<byte[]>() {
public byte[] convertFromBase64Png(String base64Png) {
return Base64.getDecoder().decode(base64Png);
return Base64.getMimeDecoder().decode(base64Png);
}

public byte[] convertFromPngBytes(byte[] png) {
Expand Down
2 changes: 1 addition & 1 deletion java/client/src/org/openqa/selenium/io/Zip.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private void addToZip(String basePath, ZipOutputStream zos, File toAdd) throws I
}

public void unzip(String source, File outputDir) throws IOException {
byte[] bytes = Base64.getDecoder().decode(source);
byte[] bytes = Base64.getMimeDecoder().decode(source);

ByteArrayInputStream bis = null;
try {
Expand Down

0 comments on commit 10f20c7

Please sign in to comment.