From b911eeef17dbcccba8065644563c963c652ddc55 Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Fri, 16 Feb 2024 10:13:10 -0800 Subject: [PATCH] erasing Expect iterates entire header table --- src/detail/header.cpp | 2 +- test/unit/fields_base.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/detail/header.cpp b/src/detail/header.cpp index 6c5d6b18..d92b0772 100644 --- a/src/detail/header.cpp +++ b/src/detail/header.cpp @@ -751,7 +751,7 @@ on_erase_expect() return; */ // reset and re-insert - auto n = md.expect.count; + auto n = count; auto const p = cbuf + prefix; auto const* e = &tab()[0]; md.expect = {}; diff --git a/test/unit/fields_base.cpp b/test/unit/fields_base.cpp index bbec9f11..23a7c605 100644 --- a/test/unit/fields_base.cpp +++ b/test/unit/fields_base.cpp @@ -1271,7 +1271,9 @@ struct fields_base_test req.count(field::expect), 1); }, "POST / HTTP/1.1\r\n" + "Content-Length: 1234\r\n" "Expect: 100-continue\r\n" + "Connection: close\r\n" "Expect: 404-not-found\r\n" "\r\n");