Skip to content

Commit a6bdb60

Browse files
committed
client: show Conten-Type in JSONL response
1 parent a8bb512 commit a6bdb60

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

debian/changelog

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ cm4all-pond (0.35) unstable; urgency=low
22

33
* client: show REMOTE_HOST in message lines
44
* client: support ISO8601 time stamps in message lines
5+
* client: show Conten-Type in JSONL response
56

67
--
78

src/client/FormatJson.cxx

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "time/ISO8601.hxx"
1111
#include "net/log/String.hxx"
1212
#include "net/log/Datagram.hxx"
13+
#include "net/log/ContentType.hxx"
1314
#include "util/StringBuffer.hxx"
1415

1516
char *
@@ -66,6 +67,10 @@ FormatJson(char *buffer, char *end,
6667
if (d.valid_length)
6768
o.AddMember("length", d.length);
6869

70+
if (const auto content_type = Net::Log::ToString(d.content_type);
71+
!content_type.empty())
72+
o.AddMember("content_type", content_type);
73+
6974
if (d.valid_traffic) {
7075
o.AddMember("traffic_received", d.traffic_received);
7176
o.AddMember("traffic_sent", d.traffic_sent);

0 commit comments

Comments
 (0)