# File lib/aws/s3/request.rb, line 124
      def canonicalized_resource

        parts = []

        # virtual hosted-style requests require the hostname to appear
        # in the canonicalized resource prefixed by a forward slash.
        if 
          Client.dns_compatible_bucket_name?(bucket) and
          !Client.path_style_bucket_name?(bucket)
        then
          parts << "/#{bucket}"
        end
  
        # all requests require the portion of the un-decoded uri up to
        # but not including the query string
        parts << path
 
        # lastly any sub resource querystring params need to be appened
        # in lexigraphical ordered joined by '&' and prefixed by '?'
        params = (sub_resource_params + query_parameters_for_signature)
        unless params.empty?
          parts << '?'
          parts << params.sort.collect{|p| p.to_s }.join('&')
        end

        parts.join
      end