adds websocketpp::USER_AGENT constant

This commit is contained in:
Peter Thorson
2012-03-10 11:22:25 -06:00
parent cedfddd8ed
commit d1b552691a
3 changed files with 4 additions and 2 deletions

View File

@@ -48,6 +48,8 @@
// Defaults
namespace websocketpp {
static const std::string USER_AGENT = "WebSocket++/0.2.0dev";
typedef std::vector<unsigned char> binary_string;
typedef boost::shared_ptr<binary_string> binary_string_ptr;

View File

@@ -412,7 +412,7 @@ void client<endpoint>::connection<connection_type>::write_request() {
// Unless the user has overridden the user agent, send generic WS++
if (m_request.header("User Agent") == "") {
m_request.replace_header("User Agent","WebSocket++/2012-03-09");
m_request.replace_header("User Agent",USER_AGENT);
}

View File

@@ -555,7 +555,7 @@ void server<endpoint>::connection<connection_type>::write_response() {
// TODO: HTTP response
}
m_response.replace_header("Server","WebSocket++/0.2.0");
m_response.replace_header("Server",USER_AGENT);
std::string raw = m_response.raw();