mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Fix HEAD requests on large files for Android
ByteArrayOutputStream was always allocated with the size of content-length, even on HEAD requests
This commit is contained in:
@@ -41,6 +41,7 @@ public class Async
|
||||
{
|
||||
private static final String DeleteMethod = "DELETE";
|
||||
private static final String GetMethod = "GET";
|
||||
private static final String HeadMethod = "HEAD";
|
||||
private static CookieManager cookieManager;
|
||||
|
||||
public static class KeyValuePair
|
||||
@@ -300,7 +301,10 @@ public class Async
|
||||
|
||||
// build the result
|
||||
result.getHeaders(connection);
|
||||
result.readResponseStream(connection, openedStreams, options);
|
||||
if (!requestMethod.equals(HeadMethod))
|
||||
{
|
||||
result.readResponseStream(connection, openedStreams, options);
|
||||
}
|
||||
|
||||
// close the opened streams (saves copy-paste implementation
|
||||
// in each method that throws IOException)
|
||||
|
||||
Reference in New Issue
Block a user