summaryrefslogtreecommitdiffstats
path: root/net/server/web_socket.cc
diff options
context:
space:
mode:
authorpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-11 09:44:41 +0000
committerpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-11 09:44:41 +0000
commite67d2179178b955a07df2c908d8c49a26fb0e71d (patch)
treec7f1113691da747da61a7e76b5574d25ba2afebf /net/server/web_socket.cc
parenta942b8c1ca4b002376306cf399e000d0842c630b (diff)
downloadchromium_src-e67d2179178b955a07df2c908d8c49a26fb0e71d.zip
chromium_src-e67d2179178b955a07df2c908d8c49a26fb0e71d.tar.gz
chromium_src-e67d2179178b955a07df2c908d8c49a26fb0e71d.tar.bz2
DevTools: add /json/activate/ command to the discovery protocol.
This change adds suppot for /activate command and refactors the json commands handling so that all commands supported jsonp properly. For the jsonp support, we always respond with 200 OK and specify the actual code in the jsonp call parameter. For the above purposes, migrates net/server/http_server from Send404() scheme to Send(net::HTTP_NOT_FOUND). BUG=157495 Review URL: https://chromiumcodereview.appspot.com/11499004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172285 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/server/web_socket.cc')
-rw-r--r--net/server/web_socket.cc18
1 files changed, 12 insertions, 6 deletions
diff --git a/net/server/web_socket.cc b/net/server/web_socket.cc
index e2829da..398e4e0 100644
--- a/net/server/web_socket.cc
+++ b/net/server/web_socket.cc
@@ -115,14 +115,18 @@ class WebSocketHixie76 : public net::WebSocket {
std::string key2 = request.GetHeaderValue("Sec-WebSocket-Key2");
if (key1.empty()) {
- connection->Send500("Invalid request format. "
- "Sec-WebSocket-Key1 is empty or isn't specified.");
+ connection->Send(net::HTTP_INTERNAL_SERVER_ERROR,
+ "Invalid request format. "
+ "Sec-WebSocket-Key1 is empty or isn't specified.",
+ "text/html");
return;
}
if (key2.empty()) {
- connection->Send500("Invalid request format. "
- "Sec-WebSocket-Key2 is empty or isn't specified.");
+ connection->Send(net::HTTP_INTERNAL_SERVER_ERROR,
+ "Invalid request format. "
+ "Sec-WebSocket-Key2 is empty or isn't specified.",
+ "text/html");
return;
}
@@ -175,8 +179,10 @@ class WebSocketHybi17 : public WebSocket {
std::string key = request.GetHeaderValue("Sec-WebSocket-Key");
if (key.empty()) {
- connection->Send500("Invalid request format. "
- "Sec-WebSocket-Key is empty or isn't specified.");
+ connection->Send(net::HTTP_INTERNAL_SERVER_ERROR,
+ "Invalid request format. "
+ "Sec-WebSocket-Key is empty or isn't specified.",
+ "text/html");
return NULL;
}
return new WebSocketHybi17(connection, request, pos);