<commit_before>module Sepa
  class NordeaResponse < Response

    def initialize(response, command: nil)
      super

      if @command == :get_certificate
        @application_response = extract_application_response('http://bxd.fi/CertificateService')
      end

      @content = extract_own_cert
    end

    def extract_own_cert
      node = Nokogiri::XML(@application_response)
      .at('xmlns|Certificate > xmlns|Certificate', xmlns: 'http://filetransfer.nordea.com/xmldata/')

      OpenSSL::X509::Certificate.new(process_cert_value(node.content)) if node
    end
  end
end<commit_msg>Fix a bug where content was set to non-existing certificate when command wasn't get certificate for nordea<commit_after>module Sepa
  class NordeaResponse < Response

    def initialize(response, command: nil)
      super

      if @command == :get_certificate
        @application_response = extract_application_response('http://bxd.fi/CertificateService')
        @content = extract_own_cert
      end
    end

    def extract_own_cert
      node = Nokogiri::XML(@application_response)
      .at('xmlns|Certificate > xmlns|Certificate', xmlns: 'http://filetransfer.nordea.com/xmldata/')

      OpenSSL::X509::Certificate.new(process_cert_value(node.content)) if node
    end
  end
end
{'fraction_non_alphanumeric': 0.09546165884194054, 'fraction_numerical': 0.004694835680751174, 'mean_word_length': 3.7195571955719555, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2544485', 'n_tokens_mistral': 386, 'n_tokens_neox': 367, 'n_words': 81}