Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,7 @@ internal class CaptureOkHttpEventListener internal constructor(

// Do not use OkHttp's `isSuccess` logic for determining whether a given response is
// successful or not to keep iOS and Android implementation in sync.
val isSuccess = (statusCode in 200..<300) ||
statusCode == 304 // "Not Modified" status code
val isSuccess = (statusCode in 200..<400)

// Capture response URL attributes in case there was a redirect and attributes such as host,
// path, and query have different values for the original request and the response.
Expand All @@ -238,7 +237,7 @@ internal class CaptureOkHttpEventListener internal constructor(
} else {
HttpResponse.HttpResult.FAILURE
},
statusCode = response.code,
statusCode = statusCode,
headers = response.headers.toMap(),
)

Expand Down
3 changes: 1 addition & 2 deletions platform/swift/source/network/native/HTTPStatus.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ struct HTTPStatus {

private extension Int {
var isSuccess: Bool {
return (200..<300).contains(self)
|| self == 304 // "Not Modified" status code
return (200..<400).contains(self)
}
}