fixes issue where custom headers couldn't be set for client connections

This commit is contained in:
Peter Thorson
2013-09-25 08:18:46 -05:00
parent f22c542a0d
commit d17569fa87
5 changed files with 77 additions and 33 deletions

View File

@@ -174,7 +174,7 @@ BOOST_AUTO_TEST_CASE( basic_client_websocket ) {
//std::string output = "HTTP/1.1 101 Switching Protocols\r\nConnection: upgrade\r\nSec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo=\r\nServer: foo\r\nUpgrade: websocket\r\n\r\n";
std::string ref = "GET / HTTP/1.1\r\nConnection: Upgrade\r\nHost: localhost\r\nSec-WebSocket-Key: AAAAAAAAAAAAAAAAAAAAAA==\r\nSec-WebSocket-Version: 13\r\nUpgrade: websocket\r\nUser-Agent: foo\r\n\r\n";
std::string ref = "GET / HTTP/1.1\r\nConnection: Upgrade\r\nFoo: Bar\r\nHost: localhost\r\nSec-WebSocket-Key: AAAAAAAAAAAAAAAAAAAAAA==\r\nSec-WebSocket-Version: 13\r\nUpgrade: websocket\r\nUser-Agent: foo\r\n\r\n";
std::stringstream output;
@@ -187,6 +187,7 @@ BOOST_AUTO_TEST_CASE( basic_client_websocket ) {
client::connection_ptr con;
websocketpp::lib::error_code ec;
con = e.get_connection(uri, ec);
con->append_header("Foo","Bar");
e.connect(con);
BOOST_CHECK_EQUAL(ref, output.str());