コード例 #1
0
 def return_response(self, method, path, data, headers, response):
     if response.content:
         # fix hardcoded account ID in ARNs returned from this API
         MessageConversion.fix_account_id(response)
         # fix dates returned from this API (fixes an issue with Terraform)
         MessageConversion.fix_date_format(response)
         # fix returned error codes
         MessageConversion.fix_error_codes(method, data, response)
         # fix content-length header
         response.headers["Content-Length"] = str(len(response._content))
コード例 #2
0
 def return_response(self, method, path, data, headers, response):
     if response.content:
         # fix hardcoded account ID in ARNs returned from this API
         MessageConversion.fix_account_id(response)
         # fix dates returned from this API (fixes issues with Terraform)
         MessageConversion.fix_date_format(response)
         MessageConversion.fix_error_codes(method, data, response)
         MessageConversion.fix_xml_empty_boolean(response, BOOL_ATTRS)
         # fix content-length header
         response.headers['Content-Length'] = str(len(response._content))
コード例 #3
0
    def return_response(self, method, path, data, headers, response):
        if response.content:
            # fix hardcoded account ID in ARNs returned from this API
            MessageConversion.fix_account_id(response)
            # fix dates returned from this API (fixes issues with Terraform)
            MessageConversion.fix_date_format(response)
            MessageConversion.fix_error_codes(method, data, response)
            MessageConversion.fix_xml_empty_boolean(response, BOOL_ATTRS)

            if AWS_SDK_JS in headers.get("User-Agent", ""):
                MessageConversion.booleans_to_lowercase(response, BOOL_ATTRS)

            # fix content-length header
            response.headers["Content-Length"] = str(len(response._content))