session clean up. better error reporting for server handshake errors

This commit is contained in:
Peter Thorson
2011-09-10 09:06:45 -05:00
parent 4764d69b34
commit bbeba1b214
4 changed files with 4 additions and 15 deletions

View File

@@ -40,9 +40,8 @@ void chat_handler::validate(websocketpp::session_ptr client) {
}
// Require specific origin example
if (client->get_header("Sec-WebSocket-Origin") != "http://zaphoyd.com") {
err << "Request from unrecognized origin: "
<< client->get_header("Sec-WebSocket-Origin");
if (client->get_origin() != "http://zaphoyd.com") {
err << "Request from unrecognized origin: " << client->get_origin();
throw(handshake_error(err.str(),403));
}
}