lib/mongo/auth/aws/request.rb
def headers
          headers = {
            'content-length' => STS_REQUEST_BODY.length.to_s,
            'content-type' => 'application/x-www-form-urlencoded',
            'host' => host,
            'x-amz-date' => formatted_time,
            'x-mongodb-gs2-cb-flag' => 'n',
            'x-mongodb-server-nonce' => Base64.encode64(server_nonce).gsub("\n", ''),
          }
          # Hash#compact is available as of Ruby 2.4
          if session_token
            headers['x-amz-security-token'] = session_token
          end
          headers
        end
# Returns the hash containing the headers of the calculated canonical
# request.
#
# @note Not all of these headers are part of the signed headers list,
#   the keys of the hash are not necessarily ordered lexicographically,
#   and the keys may be in any case.
#
# @return [ <Hash> ] headers The headers.
Returns the hash containing the headers of the calculated canonical
request.
Returns the hash containing the headers of the calculated canonical request .
def headers
          headers = {
            'content-length' => STS_REQUEST_BODY.length.to_s,
            'content-type' => 'application/x-www-form-urlencoded',
            'host' => host,
            'x-amz-date' => formatted_time,
            'x-mongodb-gs2-cb-flag' => 'n',
            'x-mongodb-server-nonce' => Base64.encode64(server_nonce).gsub("\n", ''),
          }
          if session_token
            headers['x-amz-security-token'] = session_token
          end
          headers
        end
def headers headers = { 'content-length' => STS_REQUEST_BODY . length . to_s , 'content-type' => 'application/x-www-form-urlencoded' , 'host' => host , 'x-amz-date' => formatted_time , 'x-mongodb-gs2-cb-flag' => 'n' , 'x-mongodb-server-nonce' => Base64 . encode64 ( server_nonce ) . gsub ( "\n" , '' ) , } if session_token headers [ 'x-amz-security-token' ] = session_token end headers end
Returns the hash containing the headers of the calculated canonical
request.
Returns the hash containing the headers of the calculated canonical request .
# Hash#compact is available as of Ruby 2.4
headers The headers.
headers The headers .
 <Hash> 
note
Not all of these headers are part of the signed headers list, the keys of the hash are not necessarily ordered lexicographically, and the keys may be in any case.
Not all of these headers are part of the signed headers list the keys of the hash are not necessarily ordered lexicographically and the keys may be in any case .