lib/azure/signature.rb
# Generate a canonical URL from an endpoint.
#--
# Borrowed from azure-sdk-for-ruby. I had my own, but this was nicer.
#
Generate a canonical URL from an endpoint.
Borrowed from azure-sdk-for-ruby. I had my own, but this was nicer.
Generate a canonical URL from an endpoint . Borrowed from azure - sdk - for - ruby . I had my own but this was nicer .
def canonicalize_resource(uri)
      resource = '/' + account_name + (uri.path.empty? ? '/' : uri.path)
      nested = (uri.query_values(Array) || []).sort
      memo   = Hash.new { |h, k| h[k] = [] }
      hash   = nested.inject(memo){ |h, a| h[a.first] << a.last; h }
      string = hash.inject('') { |s, a| s << "\n#{a.first}:#{a.last.join(',')}"; s }
      resource + string
    end
def canonicalize_resource ( uri ) resource = '/' + account_name + ( uri . path . empty? ? '/' : uri . path ) nested = ( uri . query_values ( Array ) || [ ] ) . sort memo = Hash . new { | h , k | h [ k ] = [ ] } hash = nested . inject ( memo ) { | h , a | h [ a . first ] << a . last ; h } string = hash . inject ( '' ) { | s , a | s << "\n#{a.first}:#{a.last.join(',')}" ; s } resource + string end
Generate a canonical URL from an endpoint.
Generate a canonical URL from an endpoint .
uri
<not_specific>