From 1d38df0a314f2282b04f06a92721e6391075cbb3 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 3 Apr 2014 11:33:15 +0900 Subject: [PATCH] nghttp: Don't index authorization header field for debugging purpose --- src/nghttp.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/nghttp.cc b/src/nghttp.cc index b75b7bad..67ee791f 100644 --- a/src/nghttp.cc +++ b/src/nghttp.cc @@ -950,7 +950,11 @@ int submit_request if(i < num_initial_headers) { continue; } - build_headers.emplace_back(kv.first, kv.second); + + // To test "never index" repr, don't index authorization header + // field unconditionally. + auto no_index = util::strieq(kv.first, "authorization"); + build_headers.emplace_back(kv.first, kv.second, no_index); } std::stable_sort(std::begin(build_headers), std::end(build_headers), [](const Headers::value_type& lhs, @@ -965,7 +969,7 @@ int submit_request nva.reserve(build_headers.size()); for(auto& kv : build_headers) { - nva.push_back(http2::make_nv(kv.name, kv.value, false)); + nva.push_back(http2::make_nv(kv.name, kv.value, kv.no_index)); } auto rv = nghttp2_submit_request(client->session, &req->pri_spec,