http2: do not log empty objects for request or response

Ticket: 7741
pull/13683/head
Philippe Antoine 9 months ago committed by Jason Ish
parent c20dddb046
commit fe9da8acd6

@ -2083,6 +2083,7 @@
"request": {
"type": "object",
"additionalProperties": false,
"minProperties": 1,
"properties": {
"error_code": {
"type": "string"
@ -2114,6 +2115,7 @@
"response": {
"type": "object",
"additionalProperties": false,
"minProperties": 1,
"properties": {
"error_code": {
"type": "string"

@ -270,13 +270,23 @@ fn log_http2(tx: &HTTP2Transaction, js: &mut JsonBuilder) -> Result<bool, JsonEr
js.open_object("http2")?;
js.set_uint("stream_id", tx.stream_id as u64)?;
let mark = js.get_mark();
js.open_object("request")?;
let has_request = log_http2_frames(&tx.frames_ts, js)?;
js.close()?;
if has_request {
js.close()?;
} else {
js.restore_mark(&mark)?;
}
let mark = js.get_mark();
js.open_object("response")?;
let has_response = log_http2_frames(&tx.frames_tc, js)?;
js.close()?;
if has_response {
js.close()?;
} else {
js.restore_mark(&mark)?;
}
js.close()?; // http2
js.close()?; // http

Loading…
Cancel
Save