aboutsummaryrefslogtreecommitdiffstats
path: root/include/http.hrl
diff options
context:
space:
mode:
authorAnthony Ramine <[email protected]>2011-05-09 14:31:06 +0200
committerAnthony Ramine <[email protected]>2011-05-09 15:14:38 +0200
commit0ca8f1364b857632030dbc3735ce789686361073 (patch)
treeba2af89911ea808263913e27ebf227f18a2ad29c /include/http.hrl
parent094f5c1735f92bb13b3b02440f24781d37a393cb (diff)
downloadcowboy-0ca8f1364b857632030dbc3735ce789686361073.tar.gz
cowboy-0ca8f1364b857632030dbc3735ce789686361073.tar.bz2
cowboy-0ca8f1364b857632030dbc3735ce789686361073.zip
Implement path_info feature
The dispatcher now accepts '...' as the leading segment of Host and the trailing segment of Path, this special atom matches any remaining path tail. When given "cowboy.bugs.dev-extend.eu", host rule ['...', <<"dev-extend">>, <<"eu">>] matches and fills host_info with [<<"cowboy">>, <<"bugs">>]. When given "/a/b/c/d", path rule [<<"a">>, <<"b">>, '...'] matches and fills path_info with [<<"c">>, <<"d">>].
Diffstat (limited to 'include/http.hrl')
-rw-r--r--include/http.hrl3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/http.hrl b/include/http.hrl
index 20c63cb..7af6a7e 100644
--- a/include/http.hrl
+++ b/include/http.hrl
@@ -1,4 +1,5 @@
%% Copyright (c) 2011, Loïc Hoguin <[email protected]>
+%% Copyright (c) 2011, Anthony Ramine <[email protected]>
%%
%% Permission to use, copy, modify, and/or distribute this software for any
%% purpose with or without fee is hereby granted, provided that the above
@@ -49,9 +50,11 @@
version = {1, 1} :: http_version(),
peer = undefined :: undefined | {Address::ip_address(), Port::ip_port()},
host = undefined :: undefined | cowboy_dispatcher:path_tokens(),
+ host_info = undefined :: undefined | cowboy_dispatcher:path_tokens(),
raw_host = undefined :: undefined | binary(),
port = undefined :: undefined | ip_port(),
path = undefined :: undefined | '*' | cowboy_dispatcher:path_tokens(),
+ path_info = undefined :: undefined | cowboy_dispatcher:path_tokens(),
raw_path = undefined :: undefined | binary(),
qs_vals = undefined :: undefined
| list({Name::binary(), Value::binary() | true}),