'Select the headers from the request that need to be included
in the StringToSign.'

def headers_to_sign(self, http_request):

    host_header_value = self.host_header(self.host, http_request)
    if http_request.headers.get('Host'):
        host_header_value = http_request.headers['Host']
    headers_to_sign = {'Host': host_header_value}
    for (name, value) in http_request.headers.items():
        lname = name.lower()
        if lname.startswith('x-amz'):
            if isinstance(value, bytes):
                value = value.decode('utf-8')
            headers_to_sign[name] = value
    return headers_to_sign
