anchor.diff:      equal_paths("/buckets/testbucket/policy", rewrite_with(headers([{"host", "testbucket." ++ ?ROOT_HOST}]), "/?policy")),
       equal_paths("/buckets/testbucket/uploads", rewrite_with(headers([]), "/testbucket?uploads")),
       equal_paths("/buckets/testbucket/uploads", rewrite_with(headers([{"host", "testbucket." ++ ?ROOT_HOST}]), "/?uploads")),
  +    equal_paths("/buckets/testbucket/uploads?delimiter=D&prefix=ABC&max-uploads=10&key-marker=bob&upload-id-marker=blah", rewrite_with(headers([]), "/testbucket?uploads&upload-id-marker=blah&key-marker=bob&max-uploads=10&prefix=ABC&delimiter=D")),
  +    equal_paths("/buckets/testbucket/uploads?delimiter=D&prefix=ABC&max-uploads=10&key-marker=bob&upload-id-marker=blah", rewrite_with(headers([{"host", "testbucket." ++ ?ROOT_HOST}]), "/?uploads&upload-id-marker=blah&key-marker=bob&max-uploads=10&prefix=ABC&delimiter=D")),
  +    equal_paths("/buckets/testbucket/objects", rewrite_with('POST', headers([]), "/testbucket/?delete")),
  +    equal_paths("/buckets/testbucket/objects", rewrite_with('POST', headers([{"host", "testbucket." ++ ?ROOT_HOST}]), "/?delete")),
       %% Object Operations
       equal_paths("/buckets/testbucket/objects/testobject", rewrite_with(headers([]), "/testbucket/testobject")),
       equal_paths("/buckets/testbucket/objects/testobject", rewrite_with(headers([{"host", "testbucket." ++ ?ROOT_HOST}]), "/testobject")),
  
positive.code: 
  %% @doc Format a bucket operation query string to conform the the
  %% rewrite rules.
  -spec format_bucket_qs(string(), subresources()) -> string().
  format_bucket_qs([], []) ->
      "/objects";
  format_bucket_qs("delete", []) ->
      "/objects";
  format_bucket_qs(QS, []) ->
      ["/objects?", QS];
  format_bucket_qs(_QS, SubResources) ->
      format_subresources(SubResources).
  
  %% @doc Format an object operation query string to conform the the
  %% rewrite rules.
  -spec format_object_qs(subresources()) -> string().
  format_object_qs(SubResources) ->
      UploadId = proplists:get_value("uploadId", SubResources, []),
      PartNum = proplists:get_value("partNumber", SubResources, []),
      format_object_qs(SubResources, UploadId, PartNum).
  
negative.code: rewrite_path(Method, "/", [], Bucket) when Method =/= 'GET' ->
      lists:flatten(["/buckets/", Bucket]);
  rewrite_path(_Method, "/", QS, Bucket) ->
      {SubResources, QueryParams} = get_subresources(QS),
      lists:flatten(["/buckets/", Bucket, format_bucket_qs(QueryParams, SubResources)]);
  rewrite_path(_Method, Path, QS, Bucket) ->
      lists:flatten(["/buckets/",
                     Bucket,
  