@@ -99,14 +99,16 @@ namespace boost { namespace network { namespace http {
99
99
// We need to determine whether we've seen any of the following headers
100
100
// before setting the defaults. We use a bitset to keep track of the
101
101
// defaulted headers.
102
- enum { ACCEPT, ACCEPT_ENCODING, HOST, MAX };
102
+ enum { ACCEPT, ACCEPT_ENCODING, HOST, CONNECTION, MAX };
103
103
std::bitset<MAX> found_headers;
104
104
static char const * defaulted_headers[][2 ] = {
105
105
{consts::accept (),
106
106
consts::accept () + std::strlen (consts::accept ())},
107
107
{consts::accept_encoding (),
108
108
consts::accept_encoding () + std::strlen (consts::accept_encoding ())},
109
- {consts::host (), consts::host () + std::strlen (consts::host ())}
109
+ {consts::host (), consts::host () + std::strlen (consts::host ())},
110
+ {consts::connection (),
111
+ consts::connection () + std::strlen (consts::connection ())}
110
112
};
111
113
112
114
typedef typename headers_range<Request>::type headers_range;
@@ -167,7 +169,8 @@ namespace boost { namespace network { namespace http {
167
169
boost::copy (crlf, oi);
168
170
}
169
171
170
- if (!connection_keepalive<Tag>::value) {
172
+ if (!connection_keepalive<Tag>::value &&
173
+ !found_headers[CONNECTION]) {
171
174
boost::copy (connection, oi);
172
175
*oi = consts::colon_char ();
173
176
*oi = consts::space_char ();
0 commit comments