From 91f683075091dd308d6c6642f7bd7a5b23e962cd Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 1 Sep 2010 11:10:39 -0400 Subject: [PATCH] * Fix a bug in sendRequest_() * Use a switch statement in the service handler --- src/server.go | 7 +++---- web_frontend/main.js | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/server.go b/src/server.go index 1ce15a0..a99a951 100644 --- a/src/server.go +++ b/src/server.go @@ -45,10 +45,9 @@ func serviceHandler(connection *http.Conn, request *http.Request) { } else { okResponse(connection, files) } - return - } - - errorResponse(connection, "Unhandled action") + default: + errorResponse(connection, "Unhandled action") + } } func errorResponse(connection *http.Conn, message string) { diff --git a/web_frontend/main.js b/web_frontend/main.js index f056235..3ccbea5 100644 --- a/web_frontend/main.js +++ b/web_frontend/main.js @@ -33,7 +33,7 @@ armadillo = function() { */ armadillo.prototype.sendRequest_ = function(action, extra_data, callback) { var data = new goog.Uri.QueryData(); - data.set('action', 'list'); + data.set('action', action); data.extend(extra_data); goog.net.XhrIo.send('/service', callback, 'POST', data); }; -- 2.43.5