Skip to content

Commit

Permalink
request overwrites bad Expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
cmazakas committed Feb 16, 2024
1 parent 42cc4d6 commit 9b6d927
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/request.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//
// Copyright (c) 2021 Vinnie Falco ([email protected])
// Copyright (c) 2024 Christian Mazakas
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand All @@ -10,7 +11,6 @@
#include <boost/http_proto/request.hpp>
#include <boost/http_proto/request_view.hpp>
#include "detail/copied_strings.hpp"
#include "detail/number_string.hpp"
#include <utility>

namespace boost {
Expand Down Expand Up @@ -112,7 +112,7 @@ set_expect_100_continue(bool b)
! h_.md.expect.is_100_continue);
auto it = find(field::expect);
BOOST_ASSERT(it != end());
erase(it);
set(it, "100-continue");
return;
}

Expand All @@ -122,17 +122,9 @@ set_expect_100_continue(bool b)
return;
}

BOOST_ASSERT(h_.md.expect.ec.failed());
if(b)
{
if(! h_.md.expect.ec.failed())
{
// remove all but one
raw_erase_n(
field::expect,
h_.md.expect.count - 1);
return;
}

erase(field::expect);
append(
field::expect,
Expand Down

0 comments on commit 9b6d927

Please sign in to comment.