aboutsummaryrefslogtreecommitdiffstats
path: root/include/types.hrl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2011-03-19 17:42:03 +0100
committerLoïc Hoguin <[email protected]>2011-03-19 17:42:03 +0100
commit2c52a30b0a209cfb0814a42b814271b168ddb2e2 (patch)
tree5991a067ba529f2c7a5dbc70b6334dbecff7a18e /include/types.hrl
parentebe638165e5a5285ae595c9e0ae07b3dd919881b (diff)
downloadcowboy-2c52a30b0a209cfb0814a42b814271b168ddb2e2.tar.gz
cowboy-2c52a30b0a209cfb0814a42b814271b168ddb2e2.tar.bz2
cowboy-2c52a30b0a209cfb0814a42b814271b168ddb2e2.zip
Rewrite the dispatcher to take a list of host each having a list of paths.
* Makes more sense to parse the host only once instead of for each path. * Allows proper handling of: If the host is not a valid host on the server, the response MUST be a 400 (Bad Request) error.
Diffstat (limited to 'include/types.hrl')
-rw-r--r--include/types.hrl4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/types.hrl b/include/types.hrl
index faee24e..17882cc 100644
--- a/include/types.hrl
+++ b/include/types.hrl
@@ -28,8 +28,8 @@
-type path_tokens() :: list(string()).
-type match() :: '_' | list(string() | '_' | atom()).
--type dispatch_rules() :: {Host::match(), Path::match(),
- Handler::module(), Opts::term()}.
+-type dispatch_rules() :: {Host::match(), list({Path::match(),
+ Handler::module(), Opts::term()})}.
-type dispatch() :: list(dispatch_rules()).
-type http_method() :: 'OPTIONS' | 'GET' | 'HEAD'