Permalink
Browse files

Minor refactor of syntax

  • Loading branch information...
1 parent 81d49a5 commit 93ca996a724d047a2f10d33cb42fd593a6fb8961 @jhs jhs committed Dec 6, 2010
Showing with 10 additions and 8 deletions.
  1. +10 −8 example/src/webdirs.erl
View
@@ -84,16 +84,18 @@ start_proxy() ->
{ok, null}.
-route_request(Request) ->
- {abs_path, Path} = Request#request.path,
- ?INFO("Request for path: ~p", [Path]),
-
- case Path of
- <<"/reload">> ->
+route_request(Request)
+ -> {abs_path, Path} = Request#request.path
+ , ?INFO("Request for path: ~p", [Path])
+ %, ?INFO("Request: ~p", [Request])
+
+ , [TopLevel | _] = string:tokens(Path, "?/")
+ , case TopLevel of
+ "reload" ->
?INFO("Reloading plugin", []),
_Pid = spawn(fun() -> reload() end),
- {reply, {200, "Reloading"}, [{'Content-Type', <<"text/html">>}], <<"Policy reloaded. <a href='/'>Try now.</a>\r\n">>};
- _ ->
+ {reply, {200, "Reloading"}, [{'Content-Type', <<"text/html">>}], <<"Policy reloaded. <a href='/'>Try now.</a>\r\n">>}
+ ; _ ->
Dirs = string:tokens(Path, "/"),
case Dirs of
[] ->

0 comments on commit 93ca996

Please sign in to comment.