From f48902cee7f4a08659232ab2d3f30b6e1117752a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Tue, 18 Dec 2012 15:59:34 +0100 Subject: Improve errors when the path provided is incorrect --- src/cowboy_dispatcher.erl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3