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


##########
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:
   What does the `_json` version of print request headers pass `false` for the 
`json_compliant` flag?



-- 
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