anchor.diff:              {Path, QS, _} = mochiweb_util:urlsplit_path(RawPath),
               {Path, mochiweb_util:parse_qs(QS)}
       end.
  -
   
   %% @doc Internal function to handle rewriting the URL
   -spec rewrite_path(atom(),string(), string(), undefined | string()) -> string().
  
positive.code:     %% Bucket Operations
      equal_paths("/buckets/testbucket/objects", rewrite_with('GET', headers([]), "/testbucket")),
      equal_paths("/buckets/testbucket/objects", rewrite_with('GET', headers([{"host", "testbucket." ++ ?ROOT_HOST}]), "/")),
      equal_paths("/buckets/testbucket/objects?max-keys=20&delimiter=/&prefix=123", rewrite_with('GET', headers([]), "/testbucket?prefix=123&delimiter=/&max-keys=20")),
      equal_paths("/buckets/testbucket/objects?max-keys=20&delimiter=/&prefix=123", rewrite_with('GET', headers([{"host", "testbucket." ++ ?ROOT_HOST}]), "/?prefix=123&delimiter=/&max-keys=20")),
      equal_paths("/buckets/testbucket", rewrite_with('HEAD', headers([]), "/testbucket")),
      equal_paths("/buckets/testbucket", rewrite_with('HEAD', headers([{"host", "testbucket." ++ ?ROOT_HOST}]), "/")),
      equal_paths("/buckets/testbucket", rewrite_with('PUT', headers([]), "/testbucket")),
  
negative.code: format_query_params([{Key, []} | RestParams], QS) ->
      format_query_params(RestParams, [[Key, "&"] | QS]);
  format_query_params([{Key, Value} | RestParams], []) ->
      format_query_params(RestParams, [Key, "=", mochiweb_util:quote_plus(Value)]);
  format_query_params([{Key, Value} | RestParams], QS) ->
      format_query_params(RestParams, [[Key, "=", mochiweb_util:quote_plus(Value), "&"] | QS]).
  
  %% @doc Parse the valid subresources from the raw path.
  -spec get_subresources(string()) -> {subresources(), query_params()}.
  