aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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}.