From ea8cb93904cd2a597ecfd0129fcced25fe3d1e00 Mon Sep 17 00:00:00 2001 From: Ben Hood <0x6e6562@gmail.com> Date: Wed, 15 Jul 2009 12:13:16 +0100 Subject: [PATCH] Fixed hardcoded RPC path --- deps/rabbitmq_web_dispatch/priv/www/test-client.js | 2 +- deps/rabbitmq_web_dispatch/src/mod_http_web.erl | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/deps/rabbitmq_web_dispatch/priv/www/test-client.js b/deps/rabbitmq_web_dispatch/priv/www/test-client.js index fc2df08ebd..368f21568a 100644 --- a/deps/rabbitmq_web_dispatch/priv/www/test-client.js +++ b/deps/rabbitmq_web_dispatch/priv/www/test-client.js @@ -7,7 +7,7 @@ function log() { function testMain() { log("Starting."); - var testService = new JsonRpcService(document.location + "rpc/test", onReady); + var testService = new JsonRpcService("/rpc/test", onReady); function onReady() { testService.test_proc("Hello, world!").addCallback(log); } diff --git a/deps/rabbitmq_web_dispatch/src/mod_http_web.erl b/deps/rabbitmq_web_dispatch/src/mod_http_web.erl index 602c8a2281..3387879b8c 100644 --- a/deps/rabbitmq_web_dispatch/src/mod_http_web.erl +++ b/deps/rabbitmq_web_dispatch/src/mod_http_web.erl @@ -30,8 +30,7 @@ loop(Req, DocRoot) -> Req:serve_file(Path, DocRoot) end; 'POST' -> - %% TODO The path is hard coded to handle mod_http_test - case rfc4627_jsonrpc_mochiweb:handle("/mod_http_test/rpc", Req) of + case rfc4627_jsonrpc_mochiweb:handle("/rpc", Req) of no_match -> io:format("PROCESSING REQUEST ~p~n",[Req]), Req:not_found(); @@ -41,7 +40,7 @@ loop(Req, DocRoot) -> _ -> Req:respond({501, [], []}) end. - + %% ---------------------------------------------------------------------- %% NON-HTTP API - maybe this should go in some other module %% ----------------------------------------------------------------------