Permalink
Browse files

Strip trailing slash from user-provided base uri, if present

  • Loading branch information...
1 parent 76f61f6 commit 7f15e1c88893e16c44a24bb93d3d18b85dd1f3b1 @b b committed Jun 7, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/webmachine_decision_core.erl
View
7 src/webmachine_decision_core.erl
@@ -431,7 +431,12 @@ decision(v3n11) ->
true ->
BaseUri = case resource_call(base_uri) of
undefined -> wrcall(base_uri);
- Any -> Any
+ Any ->
+ case lists:last(Any) of
+ % 47 is "/"
+ 47 -> lists:sublist(Any, erlang:length(Any) - 1);
+ _ -> Any
+ end
end,
FullPath = filename:join([wrcall(path), NewPath]),
wrcall({set_disp_path, FullPath}),

0 comments on commit 7f15e1c

Please sign in to comment.