Skip to content

Commit 4aa3de6

Browse files
Merge pull request #4510 from NativeScript/vladimirov/handle-http-304
fix: handle HTTP 304 response status code
2 parents 7d7ce8e + 9bce91f commit 4aa3de6

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/common/constants.ts

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ export class Proxy {
9292
*/
9393
export class HttpStatusCodes {
9494
static SEE_OTHER = 303;
95+
static NOT_MODIFIED = 304;
9596
static PAYMENT_REQUIRED = 402;
9697
static PROXY_AUTHENTICATION_REQUIRED = 407;
9798
}

lib/common/http-client.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export class HttpClient implements Server.IHttpClient {
168168
this.setResponseResult(promiseActions, cleanupRequestData, { err: new Error(HttpClient.STUCK_RESPONSE_ERROR_MESSAGE) });
169169
}
170170
}, HttpClient.STUCK_RESPONSE_CHECK_INTERVAL);
171-
const successful = helpers.isRequestSuccessful(responseData);
171+
const successful = helpers.isRequestSuccessful(responseData) || responseData.statusCode === HttpStatusCodes.NOT_MODIFIED;
172172
if (!successful) {
173173
pipeTo = undefined;
174174
}

0 commit comments

Comments
 (0)