bneradt commented on code in PR #12460:
URL: https://github.com/apache/trafficserver/pull/12460#discussion_r2285649006


##########
plugins/xdebug/xdebug_headers.cc:
##########
@@ -191,14 +222,70 @@ print_response_headers(TSHttpTxn txn, std::stringstream 
&output)
   TSMLoc    hdr_loc;
   if (TSHttpTxnServerRespGet(txn, &buf_s, &hdr_loc) == TS_SUCCESS) {
     output << "{'type':'response', 'side':'server', 'headers': {\n";
-    print_headers(buf_s, hdr_loc, output);
+    print_headers(buf_s, hdr_loc, output, JSON_COMPLIANT);
     output << "\n\t}},";
     TSHandleMLocRelease(buf_s, TS_NULL_MLOC, hdr_loc);
   }
   if (TSHttpTxnClientRespGet(txn, &buf_c, &hdr_loc) == TS_SUCCESS) {
     output << "{'type':'response', 'side':'client', 'headers': {\n";
-    print_headers(buf_c, hdr_loc, output);
+    print_headers(buf_c, hdr_loc, output, JSON_COMPLIANT);
     output << "\n\t}}";
     TSHandleMLocRelease(buf_c, TS_NULL_MLOC, hdr_loc);
   }
 }
+
+void
+print_request_headers_json(TSHttpTxn txn, std::stringstream &output)
+{
+  TSMBuffer buf_c, buf_s;
+  TSMLoc    hdr_loc;
+
+  bool has_client = false;
+
+  Dbg(dbg_ctl_hdrs, "Printing client request headers for full JSON");
+  if (TSHttpTxnClientReqGet(txn, &buf_c, &hdr_loc) == TS_SUCCESS) {
+    output << "{\"client-request\":{";
+    print_headers(buf_c, hdr_loc, output, !JSON_COMPLIANT);

Review Comment:
   You're right. I had renamed this variable to try to make it less confusing, 
but inverted the symantic without realizing it. I'll update this. In fact, I'll 
dispense of the generic "json_compliant" verbage and just use "full_json" to 
make it more obvious that it ties to the xprobe_full_json user option.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to