anchor.diff:  format_query_params([{Key, []} | RestParams], QS) ->
       format_query_params(RestParams, [[Key, "&"] | QS]);
   format_query_params([{Key, Value} | RestParams], []) ->
  -    format_query_params(RestParams, [Key, "=", Value]);
  +    format_query_params(RestParams, [Key, "=", mochiweb_util:quote_plus(Value)]);
   format_query_params([{Key, Value} | RestParams], QS) ->
  -    format_query_params(RestParams, [[Key, "=", Value, "&"] | 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()}.
  
positive.code:     equal_paths("/buckets/testbucket/objects/testobject/uploads/2", rewrite_with(headers([]), "/testbucket/testobject?uploadId=2")),
      equal_paths("/buckets/testbucket/objects/testobject/uploads/2", rewrite_with(headers([{"host", "testbucket." ++ ?ROOT_HOST}]), "/testobject?uploadId=2")),
      equal_paths("/buckets/testbucket/objects/testobject/uploads/2?partNumber=1", rewrite_with(headers([]), "/testbucket/testobject?partNumber=1&uploadId=2")),
      equal_paths("/buckets/testbucket/objects/testobject/uploads/2?partNumber=1", rewrite_with(headers([{"host", "testbucket." ++ ?ROOT_HOST}]), "/testobject?partNumber=1&uploadId=2")).
  
  rewrite_header_test() ->
      Path = "/testbucket?y=z&a=b&m=n",
  
negative.code: %% @doc Format an object operation query string to conform the the
  %% rewrite rules.
  -spec format_object_qs({subresources(), query_params()}) -> string().
  format_object_qs({SubResources, QueryParams}) ->
      UploadId = proplists:get_value("uploadId", SubResources, []),
      PartNum = proplists:get_value("partNumber", SubResources, []),
      format_object_qs(SubResources, QueryParams, UploadId, PartNum).
  
  %% @doc Format an object operation query string to conform the the
  %% rewrite rules.
  -spec format_object_qs(subresources(), query_params(), string(), string()) -> string().
  format_object_qs(SubResources, QueryParams, [], []) ->
      [format_subresources(SubResources), format_query_params(QueryParams)];
  format_object_qs(_SubResources, _QueryParams, UploadId, []) ->
      ["/uploads/", UploadId];
  format_object_qs(_SubResources, _QueryParams, UploadId, PartNum) ->
      ["/uploads/", UploadId, "?partNumber=", PartNum].
  
  %% @doc Format a string that expresses the subresource request
  