<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>include/responder_base.erl</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,96 +1,6 @@
 -module(frontend_responder).
--include(&quot;yaws_api.hrl&quot;).
--include(&quot;yaws.hrl&quot;).
--include(&quot;fuzed.hrl&quot;).
+-include(&quot;responder_base.erl&quot;).
 -compile(export_all).
 
 provide_pool(_A) -&gt;
   resource_fountain:best_pool_for_details_match(details()).
-
-out404(A, _GC, SC) -&gt;
-  Parameters = [{request, {struct, parse_arg(A, SC)}}],
-  io:format(&quot;Param restructure:~n~p~n&quot;, [Parameters]),
-  Pool = provide_pool(A),
-  case node_api:safely_send_call_to_pool_no_lookup(handle_request,
-                                                   Parameters, 
-                                                   pure,
-                                                   Pool) of
-    {result, R} -&gt; 
-      convert_response(R);
-    {error, R} -&gt;
-      error_logger:info_msg(&quot;500 Internal Server Error: ~p~n&quot;, [R]),
-      [{status, 500}, {html, &quot;Sumpin fucked.&quot;}]
-  end.
-
-parse_arg(Request, ServerOptions) -&gt;
-  Headers = Request#arg.headers,
-  [convert_method(Request), 
-   convert_version(Request), 
-   convert_querypath(Request), 
-   {querydata, prep(Request#arg.querydata)}, 
-   {servername, prep(ServerOptions#sconf.servername)},
-   {headers, {struct, convert_headers(Request#arg.headers)}},
-   {cookies, {array, lists:map(fun(X) -&gt; prep(X) end, Headers#headers.cookie)}},
-   {pathinfo, prep(ServerOptions#sconf.docroot)},
-   {postdata, Request#arg.clidata}].
-    
-
-convert_method(Request) -&gt;
-  R = Request#arg.req,
-  {http_request,Method,{_Type,_Path},_} = R,
-  {method, Method}.
-
-convert_querypath(Request)  -&gt;
-   R = Request#arg.req,
-   {http_request,_Method,{_Type,Path},_} = R,
-   {querypath, prep(Path)}.
-
-convert_version(Request) -&gt;
-  R = Request#arg.req,
-  {http_request,_Method,{_Type,_Path},Version} = R,
-  {http_version, {array, tuple_to_list(Version)}}.
-
-convert_req(R) -&gt;
-  {http_request,Method,{_Type,Path},_} = R,
-  {Method, prep(Path)}.
-
-convert_headers(A) -&gt;
-  NormalHeaders = [{connection, prep(A#headers.connection)},
-                   {accept, prep(A#headers.accept)},
-                   {host, prep(A#headers.host)},
-                   {if_modified_since, prep(A#headers.if_modified_since)},
-                   {if_match, prep(A#headers.if_match)},
-                   {if_none_match, prep(A#headers.if_none_match)},
-                   {if_range, prep(A#headers.if_range)},
-                   {if_unmodified_since, prep(A#headers.if_unmodified_since)},
-                   {range, prep(A#headers.range)},
-                   {referer, prep(A#headers.referer)},
-                   {user_agent, prep(A#headers.user_agent)},
-                   {accept_ranges, prep(A#headers.accept_ranges)},
-                   {keep_alive, prep(A#headers.keep_alive)},
-                   {location, prep(A#headers.location)},
-                   {content_length, prep(A#headers.content_length)},
-                   {content_type, prep(A#headers.content_type)},
-                   {content_encoding, prep(A#headers.content_encoding)},
-                   {authorization, prep(A#headers.authorization)},
-                   {transfer_encoding, prep(A#headers.transfer_encoding)}],
-  SpecialHeaders = 
-    lists:map(fun({http_header, _Len, Name, _, Value}) -&gt; {prep(Name), prep(Value)} end, 
-              A#headers.other),
-  [{Name, Res} || {Name, Res} &lt;- NormalHeaders, Res /= undefined] ++ SpecialHeaders.
-
-convert_response({response, EhtmlTuple}) -&gt;
-  {Status, AllHeaders, Html} = EhtmlTuple,
-  {allheaders, HeaderList} = AllHeaders,
-  ProcessedHeaderList = lists:map(fun({header, Name, Value}) -&gt; {header, [binary_to_list(Name) ++ &quot;:&quot;, binary_to_list(Value)]} end,
-                                  tuple_to_list(HeaderList)),
-  {html, RawResult} = Html,
-  [Status, {allheaders, ProcessedHeaderList}, {html, binary_to_list(RawResult)}].
-
-prep(A) when is_list(A) -&gt; list_to_binary(A);
-prep(A) -&gt; A.
-
-details() -&gt;
-  {ok, Details} = 
-    application:get_env(fuzed_frontend, details),
-  Details.</diff>
      <filename>elibs/frontend_responder.erl</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>eec6db84255ed74431ac2ecd1b7629306a697273</id>
    </parent>
  </parents>
  <author>
    <name>David Fayram</name>
    <email>dfayram@gmail.com</email>
  </author>
  <url>http://github.com/KirinDave/fuzed/commit/fc71cc0e7fcfd4e09c6114963835356a9922bc64</url>
  <id>fc71cc0e7fcfd4e09c6114963835356a9922bc64</id>
  <committed-date>2008-05-11T19:41:14-07:00</committed-date>
  <authored-date>2008-05-11T19:41:14-07:00</authored-date>
  <message>Splitting out the core of a responder to responder_base.

Now we can define responders as permutations of that code, 
allowing for custom dispatch routines on a per-app basis!</message>
  <tree>f78117c92088cf779c1c37f83f54e432382e29fb</tree>
  <committer>
    <name>David Fayram</name>
    <email>dfayram@gmail.com</email>
  </committer>
</commit>
