Skip to content

Commit ee07745

Browse files
author
Alexis Oyama
committed
fix(Request): Retry on 5xx
1 parent b9968b3 commit ee07745

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Leanplum-SDK/Classes/LeanplumRequest.m

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,10 +366,9 @@ - (void)sendNow:(BOOL)async
366366
}
367367
finished = YES;
368368
LP_TRY
369-
if (completedOperation.HTTPStatusCode == 408
370-
|| completedOperation.HTTPStatusCode == 502
371-
|| completedOperation.HTTPStatusCode == 503
372-
|| completedOperation.HTTPStatusCode == 504
369+
NSInteger httpStatusCode = completedOperation.HTTPStatusCode;
370+
if (httpStatusCode == 408
371+
|| (httpStatusCode >= 500 && httpStatusCode < 600)
373372
|| err.code == kCFURLErrorCannotConnectToHost
374373
|| err.code == kCFURLErrorDNSLookupFailed
375374
|| err.code == kCFURLErrorNotConnectedToInternet

0 commit comments

Comments
 (0)