mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
fixes user agent header typo, fixes #100
This commit is contained in:
@@ -63,7 +63,7 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
con = endpoint.get_connection(uri);
|
||||
|
||||
con->add_request_header("User Agent","WebSocket++/0.2.0 WebSocket++Chat/0.2.0");
|
||||
con->add_request_header("User-Agent","WebSocket++/0.2.0 WebSocket++Chat/0.2.0");
|
||||
con->add_subprotocol("com.zaphoyd.websocketpp.chat");
|
||||
|
||||
con->set_origin("http://zaphoyd.com");
|
||||
|
||||
@@ -70,9 +70,7 @@ int main(int argc, char* argv[]) {
|
||||
endpoint.elog().unset_level(websocketpp::log::elevel::ALL);
|
||||
|
||||
con = endpoint.connect(uri+"getCaseCount");
|
||||
|
||||
con->add_request_header("User Agent","WebSocket++/0.2.0-dev");
|
||||
|
||||
|
||||
endpoint.run();
|
||||
|
||||
std::cout << "case count: " << boost::dynamic_pointer_cast<echo_client_handler>(handler)->m_case_count << std::endl;
|
||||
|
||||
@@ -126,6 +126,9 @@ void message_test::on_message(connection_ptr con,websocketpp::message::data_ptr
|
||||
m_msg.reset();
|
||||
m_pass = FAIL;
|
||||
|
||||
//std::cout << "sent: " << zsutil::to_hex(m_data) << std::endl;
|
||||
//std::cout << "recieved: " << zsutil::to_hex(msg->get_payload()) << std::endl;
|
||||
|
||||
this->end(con);
|
||||
}
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ int start_client(po::variables_map& vm) {
|
||||
|
||||
client::connection_ptr con = endpoint.get_connection(uri);
|
||||
|
||||
con->add_request_header("User Agent",user_agent);
|
||||
con->add_request_header("User-Agent",user_agent);
|
||||
con->add_subprotocol("wsperf");
|
||||
|
||||
endpoint.connect(con);
|
||||
|
||||
@@ -496,8 +496,8 @@ void client<endpoint>::connection<connection_type>::write_request() {
|
||||
m_request.replace_header("Sec-WebSocket-Key",m_handshake_key);
|
||||
|
||||
// Unless the user has overridden the user agent, send generic WS++
|
||||
if (m_request.header("User Agent") == "") {
|
||||
m_request.replace_header("User Agent",USER_AGENT);
|
||||
if (m_request.header("User-Agent") == "") {
|
||||
m_request.replace_header("User-Agent",USER_AGENT);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user