aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_http_protocol.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2011-12-22 21:48:24 +0100
committerLoïc Hoguin <[email protected]>2011-12-22 21:48:24 +0100
commit17c9d45786b23983fbecc05d27add12def3fa087 (patch)
treef6d905c3221d6cd98eb0025fd05eeb219438a041 /src/cowboy_http_protocol.erl
parent72d91583b9c1de0e5a05da4de1218679b149921d (diff)
downloadcowboy-17c9d45786b23983fbecc05d27add12def3fa087.tar.gz
cowboy-17c9d45786b23983fbecc05d27add12def3fa087.tar.bz2
cowboy-17c9d45786b23983fbecc05d27add12def3fa087.zip
Remove outdated @todo notes and update another
Diffstat (limited to 'src/cowboy_http_protocol.erl')
-rw-r--r--src/cowboy_http_protocol.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cowboy_http_protocol.erl b/src/cowboy_http_protocol.erl
index e7a5d2c..043aa11 100644
--- a/src/cowboy_http_protocol.erl
+++ b/src/cowboy_http_protocol.erl
@@ -110,11 +110,9 @@ wait_request(State=#state{socket=Socket, transport=Transport,
-spec request({http_request, http_method(), http_uri(),
http_version()}, #state{}) -> ok | none().
-%% @todo We probably want to handle some things differently between versions.
request({http_request, _Method, _URI, Version}, State)
when Version =/= {1, 0}, Version =/= {1, 1} ->
error_terminate(505, State);
-%% @todo We need to cleanup the URI properly.
request({http_request, Method, {abs_path, AbsPath}, Version},
State=#state{socket=Socket, transport=Transport,
urldecode={URLDecFun, URLDecArg}=URLDec}) ->
@@ -210,8 +208,10 @@ header(_Any, _Req, State) ->
#http_req{}, #state{}) -> ok | none().
dispatch(Next, Req=#http_req{host=Host, path=Path},
State=#state{dispatch=Dispatch}) ->
- %% @todo We probably want to filter the Host and Path here to allow
- %% things like url rewriting.
+ %% @todo We should allow a configurable chain of handlers here to
+ %% allow things like url rewriting, site-wide authentication,
+ %% optional dispatching, and more. It would default to what
+ %% we are doing so far.
case cowboy_dispatcher:match(Host, Path, Dispatch) of
{ok, Handler, Opts, Binds, HostInfo, PathInfo} ->
Next(Req#http_req{host_info=HostInfo, path_info=PathInfo,