summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2015-11-13 16:27:24 +0100
committerLinus Nordberg <linus@nordu.net>2015-11-13 16:27:24 +0100
commit1a9625f9fb0fb369246188e047a3919b8f69c845 (patch)
tree8c2a54b2396d98726d46249a3590abfd26622e17 /src
parent1ca369b723fa1c601f51cce871e22db1e18b5e8c (diff)
No need to strip "/" from path really.parametrise_url
Diffstat (limited to 'src')
-rw-r--r--src/catlfish_web.erl10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/catlfish_web.erl b/src/catlfish_web.erl
index ea34928..f44745d 100644
--- a/src/catlfish_web.erl
+++ b/src/catlfish_web.erl
@@ -27,7 +27,7 @@ split_path(Parts) ->
{Fun, App}.
loop(Req, Module) ->
- "/" ++ Path = Req:get(path), % FIXME no need to strip "/"
+ Path = Req:get(path),
{Fun, App} = split_path(string:tokens(Path, "/")),
lager:debug("Fun=~s; App=~s;", [Fun, App]),
try
@@ -38,13 +38,13 @@ loop(Req, Module) ->
Query = Req:parse_qs(),
{_, RawQuery, _} = mochiweb_util:urlsplit_path(Req:get(raw_path)),
Result = case http_auth:verify_auth(AuthHeader, "GET",
- "/" ++ Path, RawQuery) of
+ Path, RawQuery) of
failure ->
{403, [{"Content-Type", "text/plain"}],
"Invalid credentials"};
success ->
lager:debug("GET ~p ~p", [Path, Query]),
- add_auth("/" ++ Path,
+ add_auth(Path,
Module:request(get, App, Fun, Query));
noauth ->
lager:debug("GET ~p ~p", [Path, Query]),
@@ -62,13 +62,13 @@ loop(Req, Module) ->
'POST' ->
Body = Req:recv_body(),
Result = case http_auth:verify_auth(AuthHeader, "POST",
- "/" ++ Path, Body) of
+ Path, Body) of
failure ->
{403, [{"Content-Type", "text/plain"}],
"Invalid credentials"};
success ->
lager:debug("POST ~p ~p", [Path, Body]),
- add_auth("/" ++ Path,
+ add_auth(Path,
Module:request(post, App, Fun, Body));
noauth ->
lager:debug("POST ~p ~p", [Path, Body]),