Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit552749b

Browse files
committed
Fix to overwrite connection header
1 parent80826f0 commit552749b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

‎boost/network/protocol/http/algorithms/linearize.hpp‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,16 @@ namespace boost { namespace network { namespace http {
9999
// We need to determine whether we've seen any of the following headers
100100
// before setting the defaults. We use a bitset to keep track of the
101101
// defaulted headers.
102-
enum { ACCEPT, ACCEPT_ENCODING, HOST, MAX };
102+
enum { ACCEPT, ACCEPT_ENCODING, HOST,CONNECTION,MAX };
103103
std::bitset<MAX> found_headers;
104104
staticcharconst* defaulted_headers[][2] = {
105105
{consts::accept(),
106106
consts::accept() +std::strlen(consts::accept())},
107107
{consts::accept_encoding(),
108108
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())}
110112
};
111113

112114
typedeftypename headers_range<Request>::type headers_range;
@@ -167,7 +169,8 @@ namespace boost { namespace network { namespace http {
167169
boost::copy(crlf, oi);
168170
}
169171

170-
if (!connection_keepalive<Tag>::value) {
172+
if (!connection_keepalive<Tag>::value &&
173+
!found_headers[CONNECTION]) {
171174
boost::copy(connection, oi);
172175
*oi =consts::colon_char();
173176
*oi =consts::space_char();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp