[libgdata] core: Redact X-GData-Key headers



commit 67c447858d0db26b99b2d0c45abea6f31a5da154
Author: Philip Withnall <philip tecnocode co uk>
Date:   Sun Sep 30 09:20:24 2012 +0100

    core: Redact X-GData-Key headers
    
    Theyâre used by the YouTube service to pass the programâs YouTube developer
    key to the server. The developer key is semi-public, but itâs probably safest
    to redact it anyway. It isnât vital information for debugging.

 gdata/gdata-service.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gdata/gdata-service.c b/gdata/gdata-service.c
index 31a5827..7ec7ad9 100644
--- a/gdata/gdata-service.c
+++ b/gdata/gdata-service.c
@@ -2055,6 +2055,9 @@ soup_log_printer (SoupLogger *logger, SoupLoggerLogLevel level, char direction,
 			_data = soup_form_encode_hash (params);
 
 			g_hash_table_destroy (params);
+		} else if (direction == '>' && g_str_has_prefix (data, "X-GData-Key: key=") == TRUE) {
+			/* Looks like: "> X-GData-Key: key=[dev key in hex]". */
+			_data = g_strdup ("X-GData-Key: key=<redacted>");
 		} else {
 			/* Nothing to redact. */
 			_data = g_strdup (data);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]