mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(android): HEAD request should return statusCode (#132)
This commit is contained in:
@@ -386,8 +386,6 @@ public class Async
|
|||||||
|
|
||||||
public void readResponseStream(HttpURLConnection connection, Stack<Closeable> openedStreams, RequestOptions options) throws IOException
|
public void readResponseStream(HttpURLConnection connection, Stack<Closeable> openedStreams, RequestOptions options) throws IOException
|
||||||
{
|
{
|
||||||
this.statusCode = connection.getResponseCode();
|
|
||||||
|
|
||||||
int contentLength = connection.getContentLength();
|
int contentLength = connection.getContentLength();
|
||||||
|
|
||||||
InputStream inStream;
|
InputStream inStream;
|
||||||
@@ -564,6 +562,7 @@ public class Async
|
|||||||
// build the result
|
// build the result
|
||||||
result.getHeaders(connection);
|
result.getHeaders(connection);
|
||||||
result.url = options.url;
|
result.url = options.url;
|
||||||
|
result.statusCode = connection.getResponseCode();
|
||||||
result.statusText = connection.getResponseMessage();
|
result.statusText = connection.getResponseMessage();
|
||||||
if (!requestMethod.equals(HEAD_METHOD))
|
if (!requestMethod.equals(HEAD_METHOD))
|
||||||
{
|
{
|
||||||
@@ -613,4 +612,4 @@ public class Async
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user