| Index: net/server/web_socket.cc
|
| diff --git a/net/server/web_socket.cc b/net/server/web_socket.cc
|
| index df5b0ae073841cca75378b811a3503739b548273..746108548e69fd10b7ec7edcf03fe1341a69ff9c 100644
|
| --- a/net/server/web_socket.cc
|
| +++ b/net/server/web_socket.cc
|
| @@ -16,6 +16,7 @@
|
| #include "base/sys_byteorder.h"
|
| #include "net/server/http_connection.h"
|
| #include "net/server/http_server_request_info.h"
|
| +#include "net/server/http_server_response_info.h"
|
|
|
| namespace net {
|
|
|
| @@ -115,18 +116,16 @@ class WebSocketHixie76 : public net::WebSocket {
|
| std::string key2 = request.GetHeaderValue("Sec-WebSocket-Key2");
|
|
|
| if (key1.empty()) {
|
| - connection->Send(net::HTTP_INTERNAL_SERVER_ERROR,
|
| - "Invalid request format. "
|
| - "Sec-WebSocket-Key1 is empty or isn't specified.",
|
| - "text/html");
|
| + connection->Send(HttpServerResponseInfo::CreateFor500(
|
| + "Invalid request format. Sec-WebSocket-Key1 is empty or isn't "
|
| + "specified."));
|
| return;
|
| }
|
|
|
| if (key2.empty()) {
|
| - connection->Send(net::HTTP_INTERNAL_SERVER_ERROR,
|
| - "Invalid request format. "
|
| - "Sec-WebSocket-Key2 is empty or isn't specified.",
|
| - "text/html");
|
| + connection->Send(HttpServerResponseInfo::CreateFor500(
|
| + "Invalid request format. Sec-WebSocket-Key2 is empty or isn't "
|
| + "specified."));
|
| return;
|
| }
|
|
|
| @@ -179,10 +178,9 @@ class WebSocketHybi17 : public WebSocket {
|
|
|
| std::string key = request.GetHeaderValue("Sec-WebSocket-Key");
|
| if (key.empty()) {
|
| - connection->Send(net::HTTP_INTERNAL_SERVER_ERROR,
|
| - "Invalid request format. "
|
| - "Sec-WebSocket-Key is empty or isn't specified.",
|
| - "text/html");
|
| + connection->Send(HttpServerResponseInfo::CreateFor500(
|
| + "Invalid request format. Sec-WebSocket-Key is empty or isn't "
|
| + "specified."));
|
| return NULL;
|
| }
|
| return new WebSocketHybi17(connection, request, pos);
|
|
|