Skip to content

Commit

Permalink
fix: Properly encoded Resolve Debug URL (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriziodemaria authored Nov 19, 2024
1 parent 712ff6e commit 00bf389
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Sources/Confidence/DebugLogger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,16 @@ internal class DebugLoggerImpl: DebugLogger {
let ctxNetworkValue = TypeMapper.convert(structure: context)
if let ctxNetworkData = try? encoder.encode(ctxNetworkValue),
let ctxNetworkString = String(data: ctxNetworkData, encoding: .utf8) {
log(messageLevel: .DEBUG, message: "[Resolve Debug] https://app.confidence.spotify.com/flags/resolver-test?client-key=\(clientKey)&flag=flags/\(flagName)&context=\(ctxNetworkString)")
var url = URLComponents()
url.scheme = "https"
url.host = "app.confidence.spotify.com"
url.path = "/flags/resolver-test"
url.queryItems = [
URLQueryItem(name: "client-key", value: clientKey),
URLQueryItem(name: "flag", value: "flags/\(flagName)"),
URLQueryItem(name: "context", value: "\(ctxNetworkString)"),
]
log(messageLevel: .DEBUG, message: "[Resolve Debug] \(url.url?.absoluteString ?? "N/A")")
}
}

Expand Down

0 comments on commit 00bf389

Please sign in to comment.