From 99518bb680fb7664f00851c4b40aa8ac924cff44 Mon Sep 17 00:00:00 2001 From: yekolia Date: Thu, 9 Aug 2012 16:59:30 +0000 Subject: [PATCH] New: - Function 'dump_http_headers': it now supports a prefix (as second param) to be displayed as line prefix such as "\t". --- calexium_lib/web/CXM_web_dump.anubis | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/calexium_lib/web/CXM_web_dump.anubis b/calexium_lib/web/CXM_web_dump.anubis index 415d035..eb5415f 100644 --- a/calexium_lib/web/CXM_web_dump.anubis +++ b/calexium_lib/web/CXM_web_dump.anubis @@ -36,12 +36,13 @@ public define String dump_http_headers ( List(HTTP_header) l, + String prefix ) = if l is { [ ] then "", // no need to add \n => previous call has made it - [h . t] then "`\t" + h.name + " : " + h.value + "\n" + dump_http_headers(t) + [h . t] then prefix + h.name + " : " + h.value + "\n" + dump_http_headers(t, prefix) } . @@ -60,10 +61,10 @@ public define String Bool is_https, One -> String generate_trust_ticket // may be used against denial of */ - "IP Address : " + http_info.ip_address + "\n" + "IP Address : " + ip_addr_to_string(http_info.ip_address) + "\n" + "Hostname : " + http_info.hostname + "\n" + "URI : " + http_info.uri + "\n" - + "HTTP Headers : " + dump_http_headers(http_info.http_headers) // no need to add \n => dump_http_headers does it + + "HTTP Headers : \n" + dump_http_headers(http_info.http_headers,"\t") // no need to add \n => dump_http_headers does it + "Is HTTPS : " + to_String(http_info.is_https) + "\n" . -- libgit2 0.21.4