Skip to content

Commit

Permalink
Logging decypted message if logHttpTraffic is set
Browse files Browse the repository at this point in the history
  • Loading branch information
kober32 committed Jul 2, 2024
1 parent de923fd commit f42d1d5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sources/WultraPowerauthNetworking/WPNNetworkingService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ public class WPNNetworkingService {
self.responseDelegate?.responseReceived(from: request.url, statusCode: urlResponse?.statusCode, body: receivedData)
resp = envelope
case .encrypted(let envelope, let decryptedData):
D.debug("Decrypted response from \(url.absoluteString):\n\(String(data: decrypted, encoding: .utf8) ?? "empty")")
if D.logHttpTraffic {
D.debug("Decrypted response from \(url.absoluteString):\n\(String(data: decrypted, encoding: .utf8) ?? "empty")")
}
self.responseDelegate?.encryptedResponseReceived(from: request.url, statusCode: urlResponse?.statusCode, body: receivedData, decrypted: decryptedData)
resp = envelope
case .failed:
Expand Down

0 comments on commit f42d1d5

Please sign in to comment.