anchor.diff:  rewrite_path(Method, "/", [], Bucket) when Method =/= 'GET' ->
       lists:flatten(["/buckets/", Bucket]);
   rewrite_path(_Method, "/", QS, Bucket) ->
  -    SubResources = get_subresources(QS),
  -    lists:flatten(["/buckets/", Bucket, format_bucket_qs(QS, SubResources)]);
  +    {SubResources, QueryParams} = get_subresources(QS),
  +    lists:flatten(["/buckets/", Bucket, format_bucket_qs(QueryParams, SubResources)]);
   rewrite_path(_Method, Path, QS, Bucket) ->
       lists:flatten(["/buckets/",
                      Bucket,
  
positive.code: format_subresources([{Key, []} | _]) ->
      ["/", Key].
  
  %% @doc Parse the valid subresources from the raw path.
  -spec get_subresources(string()) -> subresources().
  get_subresources(QueryString) ->
      lists:filter(fun valid_subresource/1, mochiweb_util:parse_qs(QueryString)).
  
  %% @doc Determine if a query parameter key is a valid S3 subresource
  -spec valid_subresource(subresource()) -> boolean().
  
negative.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")),
  