Просмотр исходного кода

Remove outdated @todo notes and update another

Loïc Hoguin 13 лет назад
Родитель
Сommit
17c9d45786
2 измененных файлов с 4 добавлено и 6 удалено
  1. 4 4
      src/cowboy_http_protocol.erl
  2. 0 2
      src/cowboy_http_rest.erl

+ 4 - 4
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(),
 -spec request({http_request, http_method(), http_uri(),
 	http_version()}, #state{}) -> ok | none().
 	http_version()}, #state{}) -> ok | none().
-%% @todo We probably want to handle some things differently between versions.
 request({http_request, _Method, _URI, Version}, State)
 request({http_request, _Method, _URI, Version}, State)
 		when Version =/= {1, 0}, Version =/= {1, 1} ->
 		when Version =/= {1, 0}, Version =/= {1, 1} ->
 	error_terminate(505, State);
 	error_terminate(505, State);
-%% @todo We need to cleanup the URI properly.
 request({http_request, Method, {abs_path, AbsPath}, Version},
 request({http_request, Method, {abs_path, AbsPath}, Version},
 		State=#state{socket=Socket, transport=Transport,
 		State=#state{socket=Socket, transport=Transport,
 		urldecode={URLDecFun, URLDecArg}=URLDec}) ->
 		urldecode={URLDecFun, URLDecArg}=URLDec}) ->
@@ -210,8 +208,10 @@ header(_Any, _Req, State) ->
 	#http_req{}, #state{}) -> ok | none().
 	#http_req{}, #state{}) -> ok | none().
 dispatch(Next, Req=#http_req{host=Host, path=Path},
 dispatch(Next, Req=#http_req{host=Host, path=Path},
 		State=#state{dispatch=Dispatch}) ->
 		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
 	case cowboy_dispatcher:match(Host, Path, Dispatch) of
 		{ok, Handler, Opts, Binds, HostInfo, PathInfo} ->
 		{ok, Handler, Opts, Binds, HostInfo, PathInfo} ->
 			Next(Req#http_req{host_info=HostInfo, path_info=PathInfo,
 			Next(Req#http_req{host_info=HostInfo, path_info=PathInfo,

+ 0 - 2
src/cowboy_http_rest.erl

@@ -731,8 +731,6 @@ has_resp_body(Req, State) ->
 %% Set the response headers and call the callback found using
 %% Set the response headers and call the callback found using
 %% content_types_provided/2 to obtain the request body and add
 %% content_types_provided/2 to obtain the request body and add
 %% it to the response.
 %% it to the response.
-%%
-%% @todo We should give the chosen language and charset to the callback.
 set_resp_body(Req=#http_req{method=Method},
 set_resp_body(Req=#http_req{method=Method},
 		State=#state{content_type_a={_Type, Fun}})
 		State=#state{content_type_a={_Type, Fun}})
 		when Method =:= 'GET'; Method =:= 'HEAD' ->
 		when Method =:= 'GET'; Method =:= 'HEAD' ->