diff --git a/src/shrpx_http2_downstream_connection.cc b/src/shrpx_http2_downstream_connection.cc index c723b620..756180ef 100644 --- a/src/shrpx_http2_downstream_connection.cc +++ b/src/shrpx_http2_downstream_connection.cc @@ -444,7 +444,8 @@ int Http2DownstreamConnection::push_request_headers() { if (LOG_ENABLED(INFO)) { std::stringstream ss; for (auto &nv : nva) { - ss << TTY_HTTP_HD << nv.name << TTY_RST << ": " << nv.value << "\n"; + ss << TTY_HTTP_HD << StringRef{nv.name, nv.namelen} << TTY_RST << ": " + << StringRef{nv.value, nv.valuelen} << "\n"; } DCLOG(INFO, this) << "HTTP request headers\n" << ss.str(); } diff --git a/src/shrpx_http2_upstream.cc b/src/shrpx_http2_upstream.cc index dbec6c16..3eaa3368 100644 --- a/src/shrpx_http2_upstream.cc +++ b/src/shrpx_http2_upstream.cc @@ -1687,7 +1687,8 @@ void Http2Upstream::log_response_headers( Downstream *downstream, const std::vector &nva) const { std::stringstream ss; for (auto &nv : nva) { - ss << TTY_HTTP_HD << nv.name << TTY_RST << ": " << nv.value << "\n"; + ss << TTY_HTTP_HD << StringRef{nv.name, nv.namelen} << TTY_RST << ": " + << StringRef{nv.value, nv.valuelen} << "\n"; } ULOG(INFO, this) << "HTTP response headers. stream_id=" << downstream->get_stream_id() << "\n" << ss.str(); @@ -1860,7 +1861,8 @@ int Http2Upstream::submit_push_promise(const StringRef &scheme, if (LOG_ENABLED(INFO)) { std::stringstream ss; for (auto &nv : nva) { - ss << TTY_HTTP_HD << nv.name << TTY_RST << ": " << nv.value << "\n"; + ss << TTY_HTTP_HD << StringRef{nv.name, nv.namelen} << TTY_RST << ": " + << StringRef{nv.value, nv.valuelen} << "\n"; } ULOG(INFO, this) << "HTTP push request headers. promised_stream_id=" << promised_stream_id << "\n" << ss.str();