Skip to content

Commit

Permalink
Use an API supported in older system versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Ignacio Bonafonte committed Sep 28, 2023
1 parent ba0b647 commit 21d5b8c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Instrumentation/URLSession/URLSessionLogger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class URLSessionLogger {
value: AttributeValue.int(statusCode))
span.status = statusForStatusCode(code: statusCode)

if let contentLengthHeader = httpResponse.value(forHTTPHeaderField: "Content-Length"),
if let contentLengthHeader = httpResponse.allHeaderFields["Content-Length"] as? String,
let contentLength = Int(contentLengthHeader) {
span.setAttribute(key: SemanticAttributes.httpResponseBodySize.rawValue,
value: AttributeValue.int(contentLength))
Expand Down

0 comments on commit 21d5b8c

Please sign in to comment.