From b812fd001bc52c6ae8a8a0092d93715e6dc77236 Mon Sep 17 00:00:00 2001 From: Peter Thorson Date: Sun, 9 Jun 2013 16:20:53 -0500 Subject: [PATCH] Change default HTTP response error code to 426 Changes default HTTP response error code when no http_handler is defined from 500/Internal Server Error to 426/Upgrade Required --- changelog.md | 2 ++ websocketpp/impl/connection_impl.hpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/changelog.md b/changelog.md index fcb32eba56..ba526534f1 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,6 @@ HEAD +- Changes default HTTP response error code when no http_handler is defined from + 500/Internal Server Error to 426/Upgrade Required - Removes timezone from logger timestamp to work around issues with the Windows implimentation of strftime. Thank you breyed for testing and code. #257 - Switches integer literals to char literals to improve VCPP compatibility. diff --git a/websocketpp/impl/connection_impl.hpp b/websocketpp/impl/connection_impl.hpp index f23144f4ac..f479b8e89d 100644 --- a/websocketpp/impl/connection_impl.hpp +++ b/websocketpp/impl/connection_impl.hpp @@ -989,6 +989,8 @@ bool connection::process_handshake_request() { if (m_http_handler) { m_http_handler(m_connection_hdl); + } else { + set_status(http::status_code::upgrade_required); } return true;