diff options
author | Loïc Hoguin <[email protected]> | 2011-10-01 02:17:50 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2011-10-01 02:24:38 +0200 |
commit | 6572d4d374abb548cf4659b5423c7f785762e04b (patch) | |
tree | ba8376cfb517641c82b35073089eed35938483e3 /src | |
parent | 76f855ebd0ddfd6d2f02bdc8a0d6bae812c39204 (diff) | |
parent | 973e67a53ce73ef71073715f1bced5bd6be6c9a1 (diff) | |
download | cowboy-6572d4d374abb548cf4659b5423c7f785762e04b.tar.gz cowboy-6572d4d374abb548cf4659b5423c7f785762e04b.tar.bz2 cowboy-6572d4d374abb548cf4659b5423c7f785762e04b.zip |
Merge branch 'path-split-doc' of https://github.com/klaar/cowboy
Diffstat (limited to 'src')
-rw-r--r-- | src/cowboy_dispatcher.erl | 6 | ||||
-rw-r--r-- | src/cowboy_http_req.erl | 6 |
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}. |