Skip to content

Commit 9450fb1

Browse files
committed
give HTTP.Client2.Facet a better CustomStringConvertible description, for the sake of debugging
1 parent 87a9fd0 commit 9450fb1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Sources/HTTPClient/HTTP2/HTTP.Client2.Facet.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,21 @@ extension HTTP.Client2
1919
}
2020
}
2121
}
22+
extension HTTP.Client2.Facet:CustomStringConvertible
23+
{
24+
public
25+
var description:String
26+
{
27+
var string:String = ""
28+
for (key, value, _):(String, String, HPACKIndexing) in headers ?? [:]
29+
{
30+
string += "\(key): \(value)\n"
31+
}
32+
string.append("\n")
33+
string.append(String.init(decoding: body, as: Unicode.UTF8.self))
34+
return string
35+
}
36+
}
2237
extension HTTP.Client2.Facet
2338
{
2439
public

0 commit comments

Comments
 (0)