anchor.diff:  -export([
       uri/1,
       uri/2,
  +    uri/3,
       request/1,
       request/2,
  +    request/3,
       eval/1,
       call_rule/2,
       conf/0,
  
positive.code:     uri(URI, []).
  
  uri(URI, Headers) ->
      State = request2(URI, Headers),
      Var = otis_var:parse("$(URI)"),
      {_, Result} = otis_var:expand(State, Var),
      lists:flatten(Result).
  
  request(URI) ->
      request(URI, []).
  
  request(URI, Headers) ->
      State = request2(URI, Headers),
      Var = otis_var:parse("$(RESULT)"),
      {_, Result} = otis_var:expand(State, Var),
      lists:flatten(Result).
  
  request2(URI, Headers) ->
      {Scheme, Host, Port, Path, Query} = otis_utils:parse_uri(URI),
      Server_IP = otis_utils:server_ip(Host),
      Headers1  = [
        {string:to_lower(H), V, undefined, undefined}
        || {H, V} <- Headers
      ],
      State = #state{
        server_name = Host,
        server_ip   = Server_IP,
        server_port = Port,
  
negative.code:       headers     = Headers1,
        query_str   = Query
      },
      State2 = case otis_var:get_header(State1, "host") of
          {_, undefined} ->
              Host1 = otis_utils:format_host(Scheme, Host, Port),
              otis_var:set_header(State1, "host", Host1);
          _ ->
              State1
      end,
      eval(State2).
  
  eval(State) ->
      ?FIRST_RULE(State).
  