HTTPClient: log actual response status code (#2487)

We were currently logging the status code retrieved from `ETagManager`,
which made it seem like etags weren't working.

Example:
> API request completed: GET /v1/subscribers/identify (200)

With this change, we now log the actual response status code so we can
verify the server is returning the correct status code:
> API request completed: GET /v1/subscribers/identify (304)
This commit is contained in:
NachoSoto authored and GitHub committed 2023-05-15 19:28:25 -04:00
1 parent 7dbc39da51
commit d68ca889e9
2 files changed
+16 -1

No files matched your search

@@ -93,3 +93,13 @@ extension HTTPStatusCode {
}
}
extension URLResponse {
var httpStatusCode: HTTPStatusCode? {
guard let response = self as? HTTPURLResponse else { return nil }
return .init(rawValue: response.statusCode)
}
}