From 14ef58cc78259adaf8d8f06434937baa2004b823 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Fri, 15 May 2020 12:52:30 +0200 Subject: [PATCH] send_crunch_response(): Log the whole URL for inspected https requests Sponsored by: Robert Klemme --- jcc.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/jcc.c b/jcc.c index 7232e7d7..56c617be 100644 --- a/jcc.c +++ b/jcc.c @@ -848,10 +848,22 @@ static void send_crunch_response(struct client_state *csp, struct http_response /* Log that the request was crunched and why. */ log_applied_actions(csp->action); - log_error(LOG_LEVEL_CRUNCH, "%s: %s", crunch_reason(rsp), http->url); - log_error(LOG_LEVEL_CLF, "%s - - [%T] \"%s\" %s %u", - csp->ip_addr_str, http->ocmd, status_code, rsp->content_length); - +#ifdef FEATURE_HTTPS_INSPECTION + if (client_use_ssl(csp)) + { + log_error(LOG_LEVEL_CRUNCH, "%s: https://%s%s", crunch_reason(rsp), + http->hostport, http->path); + log_error(LOG_LEVEL_CLF, "%s - - [%T] \"%s https://%s%s %s\" %s %llu", + csp->ip_addr_str, http->gpc, http->hostport, http->path, + http->ver, status_code, rsp->content_length); + } + else +#endif + { + log_error(LOG_LEVEL_CRUNCH, "%s: %s", crunch_reason(rsp), http->url); + log_error(LOG_LEVEL_CLF, "%s - - [%T] \"%s\" %s %u", + csp->ip_addr_str, http->ocmd, status_code, rsp->content_length); + } /* Write the answer to the client */ #ifdef FEATURE_HTTPS_INSPECTION if (client_use_ssl(csp)) -- 2.39.2