align with 1.4.6

This commit is contained in:
aleks-f
2013-02-27 00:32:31 -06:00
parent 363c66ebdf
commit c311263eed

View File

@@ -47,7 +47,6 @@
#include "Poco/SHA1Engine.h" #include "Poco/SHA1Engine.h"
#include "Poco/Base64Encoder.h" #include "Poco/Base64Encoder.h"
#include "Poco/String.h" #include "Poco/String.h"
#include "Poco/StringTokenizer.h"
#include "Poco/Random.h" #include "Poco/Random.h"
#include "Poco/StreamCopier.h" #include "Poco/StreamCopier.h"
#include <sstream> #include <sstream>
@@ -134,8 +133,7 @@ WebSocket::Mode WebSocket::mode() const
WebSocketImpl* WebSocket::accept(HTTPServerRequest& request, HTTPServerResponse& response) WebSocketImpl* WebSocket::accept(HTTPServerRequest& request, HTTPServerResponse& response)
{ {
StringTokenizer st(request.get("Connection", ""), ",", StringTokenizer::TOK_IGNORE_EMPTY | StringTokenizer::TOK_TRIM); if (request.hasToken("Connection", "upgrade") && icompare(request.get("Upgrade", ""), "websocket") == 0)
if (st.has("Upgrade") && icompare(request.get("Upgrade", ""), "websocket") == 0)
{ {
std::string version = request.get("Sec-WebSocket-Version", ""); std::string version = request.get("Sec-WebSocket-Version", "");
if (version.empty()) throw WebSocketException("Missing Sec-WebSocket-Version in handshake request", WS_ERR_HANDSHAKE_NO_VERSION); if (version.empty()) throw WebSocketException("Missing Sec-WebSocket-Version in handshake request", WS_ERR_HANDSHAKE_NO_VERSION);