aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2011-10-01 02:17:50 +0200
committerLoïc Hoguin <[email protected]>2011-10-01 02:24:38 +0200
commit6572d4d374abb548cf4659b5423c7f785762e04b (patch)
treeba8376cfb517641c82b35073089eed35938483e3
parent76f855ebd0ddfd6d2f02bdc8a0d6bae812c39204 (diff)
parent973e67a53ce73ef71073715f1bced5bd6be6c9a1 (diff)
downloadcowboy-6572d4d374abb548cf4659b5423c7f785762e04b.tar.gz
cowboy-6572d4d374abb548cf4659b5423c7f785762e04b.tar.bz2
cowboy-6572d4d374abb548cf4659b5423c7f785762e04b.zip
Merge branch 'path-split-doc' of https://github.com/klaar/cowboy
-rw-r--r--src/cowboy_dispatcher.erl6
-rw-r--r--src/cowboy_http_req.erl6
2 files changed, 10 insertions, 2 deletions
diff --git a/src/cowboy_dispatcher.erl b/src/cowboy_dispatcher.erl
index c402e01..bb87fc9 100644
--- a/src/cowboy_dispatcher.erl
+++ b/src/cowboy_dispatcher.erl
@@ -45,7 +45,11 @@ split_host(Host) ->
list_to_integer(binary_to_list(Port))}
end.
-%% @doc Split a path into a list of tokens.
+%% @doc Split a path into a list of path segments.
+%%
+%% Following RFC2396, this function may return path segments containing any
+%% character, including <em>/</em> if, and only if, a <em>/</em> was escaped
+%% and part of a path segment.
-spec split_path(binary()) -> {path_tokens(), binary(), binary()}.
split_path(Path) ->
case binary:split(Path, <<"?">>) of
diff --git a/src/cowboy_http_req.erl b/src/cowboy_http_req.erl
index 5b63599..ead9831 100644
--- a/src/cowboy_http_req.erl
+++ b/src/cowboy_http_req.erl
@@ -88,7 +88,11 @@ raw_host(Req) ->
port(Req) ->
{Req#http_req.port, Req}.
-%% @doc Return the tokens for the path requested.
+%% @doc Return the path segments for the path requested.
+%%
+%% Following RFC2396, this function may return path segments containing any
+%% character, including <em>/</em> if, and only if, a <em>/</em> was escaped
+%% and part of a path segment in the path requested.
-spec path(#http_req{}) -> {cowboy_dispatcher:path_tokens(), #http_req{}}.
path(Req) ->
{Req#http_req.path, Req}.