aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_dispatcher.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2012-12-18 15:59:34 +0100
committerLoïc Hoguin <[email protected]>2012-12-18 15:59:34 +0100
commitf48902cee7f4a08659232ab2d3f30b6e1117752a (patch)
treeafcb742d13f94b937ca42ec0dc66315e5e67ebd0 /src/cowboy_dispatcher.erl
parent06ab46c868c15ee5b47e855e426303a128f8e7e3 (diff)
downloadcowboy-f48902cee7f4a08659232ab2d3f30b6e1117752a.tar.gz
cowboy-f48902cee7f4a08659232ab2d3f30b6e1117752a.tar.bz2
cowboy-f48902cee7f4a08659232ab2d3f30b6e1117752a.zip
Improve errors when the path provided is incorrect
Diffstat (limited to 'src/cowboy_dispatcher.erl')
-rw-r--r--src/cowboy_dispatcher.erl4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cowboy_dispatcher.erl b/src/cowboy_dispatcher.erl
index 5b75398..ef6e8ac 100644
--- a/src/cowboy_dispatcher.erl
+++ b/src/cowboy_dispatcher.erl
@@ -139,7 +139,9 @@ split_host(Host, Acc) ->
%% and part of a path segment.
-spec split_path(binary()) -> tokens().
split_path(<< $/, Path/bits >>) ->
- split_path(Path, []).
+ split_path(Path, []);
+split_path(_) ->
+ badrequest.
split_path(Path, Acc) ->
try