Skip to content

Commit e182a57

Browse files
committed
Fixing bug with HTTP/1.1 accept encoding header.
1 parent 28e523f commit e182a57

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ namespace boost { namespace network { namespace http {
101101
*oi = consts::colon_char();
102102
*oi = consts::space_char();
103103
boost::copy(default_accept_encoding, oi);
104+
boost::copy(crlf, oi);
104105
}
105106
typedef typename headers_range<basic_request<Tag> >::type headers_range;
106107
typedef typename range_iterator<headers_range>::type headers_iterator;
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
// Copyright 2010 Dean Michael Berris.
3+
// Distributed under the Boost Software License, Version 1.0.
4+
// (See accompanying file LICENSE_1_0.txt or copy at
5+
// http://www.boost.org/LICENSE_1_0.txt)
6+
7+
#define BOOST_TEST_MODULE HTTP Request Linearize Test
8+
#include <boost/network/protocol/http/request.hpp>
9+
#include <boost/network/protocol/http/algorithms/linearize.hpp>
10+
#include <boost/test/unit_test.hpp>
11+
#include <boost/mpl/list.hpp>
12+
#include <iostream>
13+
14+
namespace http = boost::network::http;
15+
namespace tags = boost::network::http::tags;
16+
namespace mpl = boost::mpl;
17+
namespace net = boost::network;
18+
19+
typedef mpl::list<
20+
tags::http_default_8bit_tcp_resolve
21+
, tags::http_default_8bit_udp_resolve
22+
, tags::http_async_8bit_tcp_resolve
23+
, tags::http_async_8bit_udp_resolve
24+
> tag_types;
25+
26+
BOOST_AUTO_TEST_CASE_TEMPLATE(linearize_request, T, tag_types) {
27+
http::basic_request<T> request("http://www.boost.org");
28+
linearize(request, "GET", 1, 0, std::ostream_iterator<typename net::char_<T>::type>(std::cout));
29+
linearize(request, "GET", 1, 1, std::ostream_iterator<typename net::char_<T>::type>(std::cout));
30+
}
31+

0 commit comments

Comments
 (0)