mirror of
https://github.com/apache/cordova-android.git
synced 2026-05-30 00:00:04 +08:00
Fix data URI decoding in CordovaResourceApi
It was not URI-decoding first, and so was broken for non-base64-encoded URIs.
This commit is contained in:
@@ -223,11 +223,11 @@ public class CordovaResourceApiTest extends ActivityInstrumentationTestCase2<Cor
|
||||
|
||||
public void testDataUriPlain() throws IOException
|
||||
{
|
||||
Uri uri = Uri.parse("data:text/plain;charset=utf-8,pass");
|
||||
Uri uri = Uri.parse("data:text/plain;charset=utf-8,pa%20ss");
|
||||
OpenForReadResult readResult = resourceApi.openForRead(uri);
|
||||
assertEquals("text/plain", readResult.mimeType);
|
||||
String data = new Scanner(readResult.inputStream, "UTF-8").useDelimiter("\\A").next();
|
||||
assertEquals("pass", data);
|
||||
assertEquals("pa ss", data);
|
||||
}
|
||||
|
||||
public void testDataUriBase64() throws IOException
|
||||
|
||||
Reference in New Issue
Block a user