Commit cef1f872 authored by Evan W. Patton's avatar Evan W. Patton Committed by Susan Rati Lane

Trim extraneous whitespace from base64-encoded aia

The base64 utility on macOS writes a carriage return at the end of the
base64 encoded string. When App Inventor attempts to read a project
template with this extra whitespace, it causes an exception to be
thrown since the server's decode() implementation expects a string
with a length multiple of 4. This change switches to using
decodeLines(), which ignores whitespace.

Change-Id: I34f6c7b1ef1fcd12b82eab67c98ffb422bbf5894
parent ecd1981e
......@@ -128,7 +128,7 @@ public class ProjectServiceImpl extends OdeRemoteServiceServlet implements Proje
// NOTE: GWT's Base64Utils uses a non-standard algorithm.
// @see: https://code.google.com/p/google-web-toolkit/issues/detail?id=3880
byte[] binData = null;
binData = Base64Util.decode(zipData);
binData = Base64Util.decodeLines(zipData);
// Import the project
ByteArrayInputStream bais = null;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment