Browse Source

Improve errors when the path provided is incorrect

Loïc Hoguin 12 years ago
parent
commit
f48902cee7
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/cowboy_dispatcher.erl

+ 3 - 1
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