diff --git a/src/shrpx_https_upstream.cc b/src/shrpx_https_upstream.cc index 776c6c2a..5e868350 100644 --- a/src/shrpx_https_upstream.cc +++ b/src/shrpx_https_upstream.cc @@ -26,6 +26,7 @@ #include #include +#include #include "shrpx_client_handler.h" #include "shrpx_downstream.h" @@ -140,6 +141,19 @@ int htp_hdrs_completecb(http_parser *htp) downstream->set_request_connection_close(!http_should_keep_alive(htp)); + if(ENABLE_LOG) { + std::stringstream ss; + ss << downstream->get_request_method() << " " + << downstream->get_request_path() << " " + << "HTTP/" << downstream->get_request_major() << "." + << downstream->get_request_minor() << "\n"; + const Headers& headers = downstream->get_request_headers(); + for(size_t i = 0; i < headers.size(); ++i) { + ss << headers[i].first << ": " << headers[i].second << "\n"; + } + LOG(INFO) << "Upstream https request headers\n" << ss.str(); + } + if(get_config()->client_proxy && downstream->get_request_method() != "CONNECT") { // Make sure that request path is an absolute URI.