Loading src/http.cpp +7 −6 Changes for src/http.cpp: 7 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -1045,9 +1045,10 @@ libhttppp::HttpResponse libhttppp::HttpClient::GetStream(libhttppp::HttpRequest auto decoded = qpack::Decoder::decode(_streamH3Raw.data() + pos, frame_len); for (const auto &h : decoded) { if (h.name == ":status") { try { res.setState(std::string("HTTP/3 ") + h.value); } catch (...) {} // parseH3, not setState: setState only stores the // reason text, leaving getStatusCode() at its default // 200 -- a proxied 307/404 then went out as 200. res.parseH3({h}); } else if (h.name == "content-length") { try { res.setContentLength(static_cast<size_t>(std::stoul(h.value))); Loading Loading @@ -1160,9 +1161,9 @@ libhttppp::HttpResponse libhttppp::HttpClient::GetStream(libhttppp::HttpRequest auto headers = _h2Decoder->decode(payload, frame_len); for (const auto &h : headers) { if (h.name == ":status") { try { res.setState(std::string("HTTP/2 ") + h.value); } catch (...) {} // See the H3 branch above: parseH2 sets the // numeric status code, setState did not. res.parseH2({h}); } else if (h.name == "content-length") { try { res.setContentLength(static_cast<size_t>(std::stoul(h.value))); Loading Loading
src/http.cpp +7 −6 Changes for src/http.cpp: 7 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -1045,9 +1045,10 @@ libhttppp::HttpResponse libhttppp::HttpClient::GetStream(libhttppp::HttpRequest auto decoded = qpack::Decoder::decode(_streamH3Raw.data() + pos, frame_len); for (const auto &h : decoded) { if (h.name == ":status") { try { res.setState(std::string("HTTP/3 ") + h.value); } catch (...) {} // parseH3, not setState: setState only stores the // reason text, leaving getStatusCode() at its default // 200 -- a proxied 307/404 then went out as 200. res.parseH3({h}); } else if (h.name == "content-length") { try { res.setContentLength(static_cast<size_t>(std::stoul(h.value))); Loading Loading @@ -1160,9 +1161,9 @@ libhttppp::HttpResponse libhttppp::HttpClient::GetStream(libhttppp::HttpRequest auto headers = _h2Decoder->decode(payload, frame_len); for (const auto &h : headers) { if (h.name == ":status") { try { res.setState(std::string("HTTP/2 ") + h.value); } catch (...) {} // See the H3 branch above: parseH2 sets the // numeric status code, setState did not. res.parseH2({h}); } else if (h.name == "content-length") { try { res.setContentLength(static_cast<size_t>(std::stoul(h.value))); Loading