diff options
author | Loïc Hoguin <[email protected]> | 2012-12-18 15:59:34 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2012-12-18 15:59:34 +0100 |
commit | f48902cee7f4a08659232ab2d3f30b6e1117752a (patch) | |
tree | afcb742d13f94b937ca42ec0dc66315e5e67ebd0 /src | |
parent | 06ab46c868c15ee5b47e855e426303a128f8e7e3 (diff) | |
download | cowboy-f48902cee7f4a08659232ab2d3f30b6e1117752a.tar.gz cowboy-f48902cee7f4a08659232ab2d3f30b6e1117752a.tar.bz2 cowboy-f48902cee7f4a08659232ab2d3f30b6e1117752a.zip |
Improve errors when the path provided is incorrect
Diffstat (limited to 'src')
-rw-r--r-- | src/cowboy_dispatcher.erl | 4 |
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 |