forked from boostorg/beast
Protect basic_fields special members (API Change)
This commit is contained in:
@@ -10,6 +10,7 @@ API Changes:
|
|||||||
* Remove header_parser
|
* Remove header_parser
|
||||||
* Add verb to on_request for parsers
|
* Add verb to on_request for parsers
|
||||||
* Refactor prepare
|
* Refactor prepare
|
||||||
|
* Protect basic_fields special members
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@@ -71,15 +71,11 @@ public:
|
|||||||
off_t len;
|
off_t len;
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
protected:
|
||||||
/// The type of allocator used.
|
//
|
||||||
using allocator_type = Allocator;
|
// These are for `header`
|
||||||
|
//
|
||||||
/// A constant iterator to the field sequence.
|
friend class fields_test;
|
||||||
class const_iterator;
|
|
||||||
|
|
||||||
/// A constant iterator to the field sequence.
|
|
||||||
using iterator = const_iterator;
|
|
||||||
|
|
||||||
/// Destructor
|
/// Destructor
|
||||||
~basic_fields();
|
~basic_fields();
|
||||||
@@ -152,6 +148,16 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
basic_fields& operator=(basic_fields<OtherAlloc> const&);
|
basic_fields& operator=(basic_fields<OtherAlloc> const&);
|
||||||
|
|
||||||
|
public:
|
||||||
|
/// The type of allocator used.
|
||||||
|
using allocator_type = Allocator;
|
||||||
|
|
||||||
|
/// A constant iterator to the field sequence.
|
||||||
|
class const_iterator;
|
||||||
|
|
||||||
|
/// A constant iterator to the field sequence.
|
||||||
|
using iterator = const_iterator;
|
||||||
|
|
||||||
/// Return a copy of the allocator associated with the container.
|
/// Return a copy of the allocator associated with the container.
|
||||||
allocator_type
|
allocator_type
|
||||||
get_allocator() const
|
get_allocator() const
|
||||||
@@ -304,7 +310,10 @@ public:
|
|||||||
swap(basic_fields<Alloc>& lhs, basic_fields<Alloc>& rhs);
|
swap(basic_fields<Alloc>& lhs, basic_fields<Alloc>& rhs);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// for header
|
//
|
||||||
|
// for `header
|
||||||
|
//
|
||||||
|
|
||||||
string_view method_impl() const;
|
string_view method_impl() const;
|
||||||
string_view target_impl() const;
|
string_view target_impl() const;
|
||||||
string_view reason_impl() const;
|
string_view reason_impl() const;
|
||||||
|
@@ -114,14 +114,14 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
fields h;
|
header<true, fields> h;
|
||||||
h.insert("User-Agent", "test");
|
h.insert("User-Agent", "test");
|
||||||
message<true, one_arg_body, fields> m{Arg1{}, h};
|
message<true, one_arg_body, fields> m{Arg1{}, h};
|
||||||
BEAST_EXPECT(h["User-Agent"] == "test");
|
BEAST_EXPECT(h["User-Agent"] == "test");
|
||||||
BEAST_EXPECT(m["User-Agent"] == "test");
|
BEAST_EXPECT(m["User-Agent"] == "test");
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
fields h;
|
header<true, fields> h;
|
||||||
h.insert("User-Agent", "test");
|
h.insert("User-Agent", "test");
|
||||||
message<true, one_arg_body, fields> m{Arg1{}, std::move(h)};
|
message<true, one_arg_body, fields> m{Arg1{}, std::move(h)};
|
||||||
BEAST_EXPECT(! h.exists("User-Agent"));
|
BEAST_EXPECT(! h.exists("User-Agent"));
|
||||||
|
Reference in New Issue
Block a user