Skip to content

Commit

Permalink
Merge pull request #214 from harish1992/statusCodeChange
Browse files Browse the repository at this point in the history
Fix to set property ClientResponse.status right
  • Loading branch information
Pushkar N Kulkarni authored Jul 22, 2019
2 parents fcb7403 + 5c22a3c commit 315aca7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Sources/KituraNet/ClientResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,13 @@ public class ClientResponse {
}
}
/// The HTTP Status code, as an Int, sent in the response by the remote server.
public internal(set) var status = -1 {
didSet {
statusCode = HTTPStatusCode(rawValue: status) ?? .unknown
}
}
public internal(set) var status = -1

/// The HTTP Status code, as an `HTTPStatusCode`, sent in the response by the remote server.
public internal(set) var statusCode: HTTPStatusCode = HTTPStatusCode.unknown {
didSet {
httpStatusCode = statusCode
status = statusCode.rawValue
}
}

Expand Down

0 comments on commit 315aca7

Please sign in to comment.